The fsIOWrite function is used to open a file and write data to it. Note that you can only write to files that have been saved to the /work/ folder (see here for details: Inaccessible Files).

 

Syntax
FsIOErr fsIOWrite(
    FsIOFile file,
    const char* pInBuffer,
    int byteOffset,
    int byteToWrite,
    FsIOFileWriteCallback callback,
    void* pUserData
);

 

Members
ParametersDescription
fileThis is the ID of a previously opened file, as returned by the fsIOOpen function.
pInBufferThis is a previously created buffer that contains the data to be written. The buffer should be at least of the size byteToWrite - byteOffset.
byteOffsetThis is the offset into the file to which data will be written.
byteToWriteThis defines the number of bytes to write to the file.
callbackCallback (FsIOFileWriteCallback) that is sent when the write operation is finished.
pUserDataPointer given to the callback to identify the function call.

 

Return Values

The function returns one of the FsIOErr codes.

 

Remarks

This function is non-blocking: it will not wait for the file to be read to pass to the next line of code.