Actions
Bug #17673
closedsysseek(0) and '1A' in header return "EOFError (end of file reached)"
Bug #17673:
sysseek(0) and '1A' in header return "EOFError (end of file reached)"
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0p0 (2020-12-25 revision 95aff21468)
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