Project

General

Profile

Actions

Bug #17673

closed

sysseek(0) and '1A' in header return "EOFError (end of file reached)"

Added by stiuna (Juan Gregorio) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0p0 (2020-12-25 revision 95aff21468)
[ruby-core:102751]

Description

The first byte of my file starts with the value '1A' .

Then:

descriptor = IO.sysopen(filePath)
file2Read = IO.new(descriptor)
file2Read.sysseek(0)
p file2Read.sysread(2).unpack('H*')
#=> "EOFError (end of file reached)"

But when I change the first byte of my file to 'AA' for example.
Then:

#=> "aa45"

Is it a bug or am I missing something? I thought sysseek only changed the cursor and nothing else.

This error only occurs with byte '1A' I did the test with the rest of the bytes [00..FF] and there is no problem except with '1A' .

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0