From: Roger Pack Date: 2009-06-10T07:07:48+09:00 Subject: Re: Errno::ENOMEM reading a device in Ruby, not in Java thou > b = " "*65000 > a.read(b.size, b) > > |>> a.read 65000 > |Errno::ENOMEM: Cannot allocate memory - /dev/nst2 > > Hmm, since read with number pre-allocate specified sized buffer, it > should work. Perhaps you have to use sysread instead of mere read, > since read method retries until exact number of bytes specified read. > > matz. Interesting. with 1.9, it will read all 64K at once (not with 1.8 though--it reads 4K blocks until it reached 64K). sysread did work with 1.8, though for some reason I had to use exactly 64K block size. file.sysread(64*1024) guess something to remember if you have to read from a tape drive. I did notice a few of these when using 1.9 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfd172a8) = -1 ENOTTY (Inappropriate ioctl for device) dunno if that's cause for concern or not. Cheers! -=r -- Posted via http://www.ruby-forum.com/.