win32file.WriteFile

int, int = WriteFile(hFile, data , ol )

Writes a string to a file

Parameters

hFile : PyHANDLE/int

Handle to the file

data : string/PyOVERLAPPEDReadBuffer

The data to write.

ol=None : PyOVERLAPPED

An overlapped structure

Comments

If you use an overlapped buffer, then it is your responsibility to ensure the string object passed remains valid until the operation completes. If Python garbage collection reclaims the buffer before the win32 API has finished with it, the results are unpredictable.

Return Value

The result is a tuple of (errCode, nBytesWritten). If errCode is not zero, it will be ERROR_IO_PENDING (ie, it is an overlapped request).
Any other error will raise an exception.