I think the following code will do the correct thing on both file systems:
try:
os.lseek(fp.fileno(), 0, os.SEEK_DATA)
except OSError as error:
if error.errno != errno.ENXIO:
raise
# OK! There is no data in the file.
else:
# BAD! There is unexpected data in the file.
I think the following code will do the correct thing on both file systems:
try: lseek(fp. fileno( ), 0, os.SEEK_DATA)
os.
except OSError as error:
if error.errno != errno.ENXIO:
raise
# OK! There is no data in the file.
else:
# BAD! There is unexpected data in the file.