From: Matt Scilipoti Date: 2003-01-23T04:08:42+09:00 Subject: Re: Test Issue with win32_popen was [ANN] win32_popen 0.1 Sorry for the late reply. I am catching up on missed emails. The date format is incorrect. Asking for MM-dd-yy, it was sent yyyy-mm-dd. I think you should just change the test: fin.print "2002-01-01\n" to fin.print "01-01-02\n" I prefer "01-13-02\n", since it avoids the mm/dd confusion. -matt -----Original Message----- From: Shashank Date [mailto:sdate@kc.rr.com] Sent: Tuesday, December 31, 2002 8:24 PM To: ruby-talk ML Subject: Re: [ANN] win32_popen 0.1 Park, Thanks a lot for this package. Unfortunately, when I compile it on my Windows XP Pro using VC++ 6.0 and run it with ruby 1.7.3 (2002-11-17) [i386-mswin32] it hangs after doing this: --------------------------------------------------- C:\test\>ruby test.rb test1 The current date is: Tue 12/31/2002 Enter the new date: (mm-dd-yy) 2002-01-01 The system cannot accept the date entered. --------------------------------------------------- Please help. Thanks and have a Very Happy New Year ! -- shanko "Park Heesob" wrote in message news:auremp$s0b$1@news.hananet.net... > Hi, all. > > win32_popen is popen2,popen3,popen4 implementation on Windows adapted from > Python source code. > > You can use win32_popen3 like this: > > require 'win32_popen' > > fin,fout,ferr = IO.win32_popen3("date") > puts fout.gets > fin.print "2002-01-01\n" > while !fout.eof > puts fout.gets > end > > fin,fout,ferr = IO.win32_popen3("irb") > > begin > a = fout.getc > putc a.chr > end while a != ?> > > fin.print "exit\n" > > while !fout.eof > puts fout.gets > end > > > You can download mswin binary for your Ruby version. > http://home.nownuri.net/~phasis/popen/win32_popen_1.6.8.zip > http://home.nownuri.net/~phasis/popen/win32_popen_1.8.0.zip > Souce code and binary included. > > [Requirement] > > * Ruby 1.6.5+ > > It may be made with other version but not verified. > > [Install binary] > > > ruby install.rb > > [Install from source] > > > ruby extconf.rb > > nmake > > ruby install.rb > > [methods] > > IO#win32_popen2(cmd[, mode]) > Executes cmd as a sub-process. Returns the file objects (child_stdin, > child_stdout). > > IO#win32_popen3(cmd[, mode]) > Executes cmd as a sub-process. Returns the file objects (child_stdin, > child_stdout, child_stderr). > > IO#win32_popen4(cmd[, mode]]) > Executes cmd as a sub-process. Returns the file objects (child_stdin, > child_stdout_and_stderr). > > Regards. > > Park Heesob > > >