Reputation: 28
I'm trying to read beyond the EOF in Python, but so far I'm failing (also tried to work with seek to position and read fixed size).
I've found a workaround which only works on Linux (and is quite slow, too) by working with debugfs and subprocess, but this is to slow and does not work on windows.
My Question: is it possible to read a file beyond EOF in python (which works on all platforms)?
Upvotes: 0
Views: 2636
Reputation: 4903
You can only move to the end using:
file.seek(0, 2)
Is that you're trying to do?
Upvotes: 1
Reputation: 386332
You can't read more bytes than is in the file. "End of file" literally means exactly that.
Upvotes: 5