Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > IO.seek behaving strangely on FreeBSD 4.9

Reply
Thread Tools

IO.seek behaving strangely on FreeBSD 4.9

 
 
Travis Whitton
Guest
Posts: n/a
 
      04-01-2004
Hi,
Initially I thought that this was a bug with rubyzip, but it appears that
something is wrong with IO.seek on FreeBSD 4.9 (at least on my system).

travis@aop:~$ uname -a
FreeBSD aop.intranet 4.9-RELEASE-p4 FreeBSD 4.9-RELEASE-p4
#0: Wed Mar 17 16:55:09 EST 2004
et:/usr/obj/usr/src/sys/MYKERNEL i386

travis@aop:~$ ruby -v
ruby 1.8.1 (2003-12-25) [i386-freebsd4]

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
 
Reply With Quote
 
 
 
 
Simon Strandgaard
Guest
Posts: n/a
 
      04-01-2004
On Thu, 01 Apr 2004 01:29:47 +0000, Travis Whitton wrote:
> Initially I thought that this was a bug with rubyzip, but it appears that
> something is wrong with IO.seek on FreeBSD 4.9 (at least on my system).
>
> travis@aop:~$ uname -a
> FreeBSD aop.intranet 4.9-RELEASE-p4 FreeBSD 4.9-RELEASE-p4
> #0: Wed Mar 17 16:55:09 EST 2004
> et:/usr/obj/usr/src/sys/MYKERNEL i386
>
> travis@aop:~$ ruby -v
> ruby 1.8.1 (2003-12-25) [i386-freebsd4]
>
> 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

server> rm somefile.txt
server> ruby b.rb
b.rb:4:in `seek': Invalid argument - somefile.txt (Errno::EINVAL)
from b.rb:4
server> 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
server> uname -a
FreeBSD server.neoneye.dk 5.1-RELEASE FreeBSD 5.1-RELEASE #0: Thu Jun 5 02:55:42 GMT 2003 :/usr/obj/usr/src/sys/GENERIC i386
server> ruby -v
ruby 1.8.1 (2003-12-22) [i386-freebsd5.1]
server>


--
Simon Strandgaard
 
Reply With Quote
 
 
 
 
Travis Whitton
Guest
Posts: n/a
 
      04-01-2004
> I get the EINVAL error on freebsd5.1

Anybody here have a FreeBSD 4.9 system they can test on with ruby 1.8.1?
 
Reply With Quote
 
Yukihiro Matsumoto
Guest
Posts: n/a
 
      04-01-2004
Hi,

In message "Re: IO.seek behaving strangely on FreeBSD 4.9"
on 04/04/01, Travis Whitton <> writes:

|> I get the EINVAL error on freebsd5.1
|
|Anybody here have a FreeBSD 4.9 system they can test on with ruby 1.8.1?

I did. It raises Errno::EFBIG.

matz.


 
Reply With Quote
 
Thomas Sondergaard
Guest
Posts: n/a
 
      04-01-2004
> I did. It raises Errno::EFBIG.

Is this something the ruby interpreter will work around?



 
Reply With Quote
 
Yukihiro Matsumoto
Guest
Posts: n/a
 
      04-01-2004
Hi,

In message "Re: IO.seek behaving strangely on FreeBSD 4.9"
on 04/04/02, "Thomas Sondergaard" <> writes:

|> I did. It raises Errno::EFBIG.
|
|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.

matz.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
re behaving strangely Josh Close Python 2 06-09-2005 06:37 PM
Stateserver behaving strangely =?iso-8859-1?q?Nils Hedstr=f6m ASP .Net 0 02-11-2005 10:04 AM
cd drive behaving strangely bj Computer Information 2 01-02-2005 02:31 PM
CD DRIVE BEHAVING STRANGELY-VIRUS? bj Computer Security 0 12-31-2004 07:08 PM
Help. My PC is behaving strangely kackson Computer Support 2 02-01-2004 03:45 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57