<< Previous | Next >> | |
|
int fat_xWrite( FATfile *file, long xbuf, int len );
Description
- Writes characters into the file specified by the file pointer beginning at the current position in the file. Characters will be copied from the
xmem
string pointed to byxbuf
. Thelen
variable controls how many characters will be written. This can be more than one sector in length, and the write function will allocate additional sectors if needed. Data will be written into the file starting at the current file position regardless of existing data. Overwriting at specific points in the file can be accomplished by calling thefat_Seek()
function before callingfat_xWrite()
.Parameters
- file
- Handle for the open file being written.
- xbuf
xmem
address of the buffer to be written.
- len
- Length of data to write.
Return Value
- Number of bytes written: success. (may be less than
len
, or zero if non-blocking mode)
-EIO
: device I/O error.
-EINVAL
:file
,xbuf
, orlen
contain invalid values.
-ENOENT
: the file/directory does not exist.
-ENOSPC
: there are no more sectors to allocate on the device.
-EFAULT
: there is a problem in the file (broken cluster chain, etc.).
-EPERM
: the file is locked or write-protected.
-EBUSY
: the device is busy (only if non-blocking).
-EFSTATE
: file is in inappropriate state (only if non-blocking).Library
- FAT.LIB
See Also
- fat_Open, fat_Read, fat_Write, fat_Seek
Dynamic C Functions | << Previous | Next >> | rabbit.com |