This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Kuberan.Naganathan, neologix, pitrou, vstinner
Date 2011-07-13.14:45:12
SpamBayes Score 6.3680083e-09
Marked as misclassified No
Message-id <1310568313.72.0.596738428508.issue12545@psf.upfronthosting.co.za>
In-reply-to
Content
> How would it work? The C lseek() takes a signed (64-bit) offset
> as argument, so we would have to call it multiple times anyway.

Python does already call multiple times the same function if the input is larger than the type used by the function. Some examples:

 - mbcs codec: work on chunk on INT_MAX bytes (input size type: Py_ssize_t)
 - zlib: crc32() works on chunk on UINT_MAX bytes (input size type: Py_ssize_t)

We have also functions processing fewer data if the function cannot handle all data: FileIO.write() clamps the buffer size of INT_MAX on Windows for example.

If we call lseek() multiple times, the implementation will depend on the whence value: SEEK_SET will use SEEK_SET and then SEEK_CUR. For SEEK_CUR, all calls can use SEEK_CUR. For SEEK_END... hum? SEEK_END and then SEEK_CUR?

I vote -1 for this feature because I bet that the behaviour of lseek() with an file position > 2^63 or offset > 2^63 highly depend on the platform (kernel, libc) version.

You can implement it in Python for your usecase. I prefer to keep a thin wrapper with an known and reliable behaviour.
History
Date User Action Args
2011-07-13 14:45:13vstinnersetrecipients: + vstinner, pitrou, neologix, Kuberan.Naganathan
2011-07-13 14:45:13vstinnersetmessageid: <1310568313.72.0.596738428508.issue12545@psf.upfronthosting.co.za>
2011-07-13 14:45:13vstinnerlinkissue12545 messages
2011-07-13 14:45:12vstinnercreate