pread/pwrite (was Re: files: direct access - NOT sequential)
Alex Martelli
aleax at aleax.it
Tue Apr 15 18:00:25 EDT 2003
On Tuesday 15 April 2003 08:21 pm, Jeff Epler wrote:
...
> pread() call. (if you *always* want to append to the file, there's a way
> to do that now with write(), isn't there? opening with os.open(,O_APPEND)
Yep, but if you sometimes want to append and sometimes to write to
a specific offset?
> / file(,"a"). Hm, what does pwrite() do on a file opened with
> O_APPEND?)
No idea (not familiar with pwrite &c).
> I was really thing in "wrap C routines to Python" mode, not "what would
> be a useful way to expose this kind of functionality to Python" mode...
Then Guido will likely not be all that interested, since the redesign I was
mentioning is about getting _away_ from dependencies on the underlying
C libraries. Maybe there's a space for these platform-dependent syscalls
in posix.* or whatever for specific platforms, I dunno.
> that library in another thread you'd want this. Blech. But if you're
> writing a Python program you'd probably never use something as primitive
> as a single file object shared in multiple threads.
Me? I sure wouldn't, right. But if others are doing it, perhaps module
posix should expose this, I dunno.
Alex
More information about the Python-list
mailing list