From: Dave Burt Date: 2004-11-12T16:33:28+09:00 Subject: forking (etc) on windows (was Re: Writing a looping, low-configuration script in Ruby) > On Fri, 12 Nov 2004 05:58:29 +0900, Dave Burt wrote: >> > "crontab -e" >> >> > $ crontab - >> > */30 * * * * /path/to/script.rb >> >> > Process.fork do >> > ... >> > sleep... >> >> This is a generally useful thing to do. >> >> Is there any standard way to do this on windows? Is using win32/popen3 >> library the preferred way? How can you write a script that will work "out >> of >> the box" (ie one-click-installer) on windows as well as doing the normal >> unix thing on unix? "Logan Capaldo" wrote... >I had thought that Process.fork works out of the box on windows, am I > wrong? I didn't really want to reboot to try it out. (Isn't laziness > supposed to be a virtue?) You could run the ruby interpreter under > Cygwin in windows and then I am (almost) positive it will work. C:\WINDOWS>ruby -v ruby 1.8.1 (2003-12-25) [i386-mswin32] C:\WINDOWS>irb irb(main):001:0> Process.fork {puts "I'm a child"} NotImplementedError: The fork() function is unimplemented on this machine from (irb):1:in `fork' from (irb):1 irb(main):002:0> exit Cygwin doesn't count. What's against win32/popen3 being included in the one-click installer? Cheers, Dave