1.2.7.4.18 SYS_FS_FileStringPut Function
1.2.7.4.18 C
SYS_FS_RESULT SYS_FS_FileStringPut
(
SYS_FS_HANDLE handle,
const char *string
);
1.2.7.4.18 Summary
Writes a string to a file.
1.2.7.4.18 Description
This function writes a string into a file. The string to be written should be NULL terminated. The terminator character will not be written.
1.2.7.4.18 Precondition
The file into which a string has to be written, has to be present and should have been opened.
1.2.7.4.18 Parameters
| Parameters | Description |
|---|---|
| handle | File handle to which string is to be written |
| string | Pointer to the null terminated string which has to be written into file |
1.2.7.4.18 Returns
SYS_FS_RES_SUCCESS - String write operation was successful.
SYS_FS_RES_FAILURE - 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.18 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_FileStringPut(fileHandle, "Hello World"); if(res != SYS_FS_RES_SUCCESS) { // String write operation failed. }
1.2.7.4.18 Remarks
None.
