travis@aop:~$ cat badseek.rb
f = File.new(“somefile.txt”, “w”) # make an empty file
f.close
f = File.new(“somefile.txt”)
f.seek(-1, IO::SEEK_END)
f.read
travis@aop:~$ ruby badseek.rb
badseek.rb:3:in `seek’: File too large - somefile.txt (Errno::EFBIG)
from badseek.rb:3
I know that the seek index is invalid, so I should get Errno::EINVAL, but why
am I getting Errno:EFBIG? This seems to be causing a problem preventing me
from using rubyzip on my machine when it tries to do a valid seek on a zipfile.
travis@aop:~$ cat badseek.rb
f = File.new(“somefile.txt”, “w”) # make an empty file
f.close
f = File.new(“somefile.txt”)
f.seek(-1, IO::SEEK_END)
f.read
travis@aop:~$ ruby badseek.rb
badseek.rb:3:in `seek’: File too large - somefile.txt (Errno::EFBIG)
from badseek.rb:3
I know that the seek index is invalid, so I should get Errno::EINVAL, but why
am I getting Errno:EFBIG? This seems to be causing a problem preventing me
from using rubyzip on my machine when it tries to do a valid seek on a zipfile.
Thanks,
Travis Whitton
I get the EINVAL error on freebsd5.1
rm somefile.txt
ruby b.rb
b.rb:4:in `seek’: Invalid argument - somefile.txt (Errno::EINVAL)
from b.rb:4
cat b.rb
f = File.new(“somefile.txt”, “w”) # make an empty file
f.close
f = File.new(“somefile.txt”)
f.seek(-1, IO::SEEK_END)
f.read
uname -a
FreeBSD server.neoneye.dk 5.1-RELEASE FreeBSD 5.1-RELEASE #0: Thu Jun 5 02:55:42 GMT 2003 root@wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC i386
ruby -v
ruby 1.8.1 (2003-12-22) [i386-freebsd5.1]
···
On Thu, 01 Apr 2004 01:29:47 +0000, Travis Whitton wrote:
Is this something the ruby interpreter will work around?
We just can’t provide every work around for every bad behavior on
every operating system. Most methods corresponding to system calls
raise exception according to their errno status. If FreeBSD current
reports EFBIG, the method would (and should) raise exception
accordingly, I guess.