From: KONTRA Gergely Date: 2003-08-21T21:09:28+09:00 Subject: Re: p format - ruby bug? - dumb program? On 0813, KONTRA Gergely wrote: > Hi! > > Can I specify how strings are printed, when using the p function? > I mean with ' or with " ? > > --- > During running a little program, which detects files with the same > content, I get a ruby bug: [...] > processing dir c:\WINDOWS\SYSTEM\Drivers > Ooops c:\WINDOWS\SYSTEM\VJOYD.VXD: No such file or directory - > c:\WINDOWS\SYSTEM > \DirectX\Migrate\vjoyd.vxd > same.rb:4: [BUG] rb_sys_fail() - errno == 0 > ruby 1.8.0 (2003-08-04) [i386-mingw32] > > > abnormal program termination code snippet: > def equalFiles? fn1, fn2 > f1=File.open fn1,'r' > f2=File.open fn2,'r' > while chunk1=f1.read(512) > chunk2=f2.read(512) > return false if chunk1!=chunk2 > end > return true > end The problem was: files are opened, but none of them are closed explicitly. The ruby output is a bit misleading. Can it be improved? Gergo -- +-[ Kontra, Gergely PhD student Room IB113 ]---------+ | http://www.mcl.hu/~kgergely "Olyan langesz vagyok, hogy | | Mobil:(+36 20) 356 9656 ICQ: 175564914 poroltoval kellene jarnom" | +-- Magyar php mirror es magyar php dokumentacio: http://hu.php.net --+