Implementing linux/unix’s “touch” command on windows.

Purpose of the touch command: create a new file or ‘touch’ some file to update its timestamp; naturally, touching a file that isn’t there will create a new file with a current time and date timestamp.

The binary file is included at the end of this post. However, if you want to “compile” this on your own, you’ll need:

  1. Ruby 1.9.3 (
  2. Ruby 1.9.3 devkit ( — follow the directions at to add the devkit, just in case.
  3. The ocra rubygem (in command prompt [cmd.exe] — type “gem install ocra” without the quotes

Then, with the source code saved as something like touch.rb, do:

You’ll then have touch.exe, which you can place in your C:/windows/system32 folder or /path_to_ruby/bin/ folder, and can use it as so:

Touch.zipSource code and binary.



Whenever I try to create a session on my website and specify the absolute location (ex: /home/lyreamc/public_html/) of the folder, CGI::Session creates the folder and the file, but the file is never modified again; it’s as if CGI::Session isn’t working at all after that. But here’s where it gets weird. If I just set the directory to /tmp everything works perfectly, however, this is a location I have no access to via ftp (and they won’t let me ssh). I made a file to view what was in that folder, and there were a bunch of session files similar to mine. Weird. I’m not sure if it’s a permissions issue, but I’m too tired right now to care.

Oh, yeah, classes start tomorrow. I had to enroll in a hurry…

Computer Architecture
Economic History Of The US
Intro To Statistics
Contemporary Art & Theory