
11 Jan
2005
11 Jan
'05
8:49 a.m.
Marcin 'Qrczak' Kowalczyk wrote:
"fileRead :: File -> FileOffset -> Integer -> Buffer -> IO ()"
This is unimplementable safely if the descriptor is read concurrently by different processes. The current position is shared.
UNIX98 defines function: extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset); Windows has: BOOL ReadFile( HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ); Where that OVERLAPPED structure contains information where to start read. Seems implementable to me, or am I wrong? -- Gracjan