1.2.7.4.23 SYS_FS_FilePrintf Function
1.2.7.4.23 C
SYS_FS_RESULT SYS_FS_FilePrintf
(
SYS_FS_HANDLE handle,
const char *string,
...
);
1.2.7.4.23 Summary
Writes a formatted string into a file.
1.2.7.4.23 Description
This function writes a formatted string into a file.
1.2.7.4.23 Precondition
The file into which a string has to be written, must exist and should be open.
1.2.7.4.23 Parameters
| Parameters | Description |
|---|---|
| handle | File handle to which formatted string is to be written |
| string | Pointer to formatted string which has to be written into file |
1.2.7.4.23 Returns
SYS_FS_RES_SUCCESS - Formatted string write operation was successful.
SYS_FS_RES_FAILURE - Formatted string write operation was unsuccessful. The reason for the failure can be retrieved with SYS_FS_Error or SYS_FS_FileError.
1.2.7.4.23 Example
SYS_FS_RESULT res; SYS_FS_HANDLE fileHandle; fileHandle = SYS_FS_FileOpen("/mnt/myDrive/FILE.txt", (SYS_FS_FILE_OPEN_WRITE_PLUS)); if(fileHandle != SYS_FS_HANDLE_INVALID) { // File open is successful } // Write a string res = SYS_FS_FilePrintf(fileHandle, "Hello World %d", 1234); if( res != SYS_FS_RES_SUCCESS) { // write operation failed. }
1.2.7.4.23 Remarks
None.
