Go to the source code of this file.
|
LE_API_FILESYSTEM le_result_t | le_fs_Open (const char *filePath, le_fs_AccessMode_t accessMode, le_fs_FileRef_t *fileRefPtr) |
|
LE_API_FILESYSTEM le_result_t | le_fs_Close (le_fs_FileRef_t fileRef) |
|
LE_API_FILESYSTEM le_result_t | le_fs_Read (le_fs_FileRef_t fileRef, uint8_t *bufPtr, size_t *bufSizePtr) |
|
LE_API_FILESYSTEM le_result_t | le_fs_Write (le_fs_FileRef_t fileRef, const uint8_t *bufPtr, size_t bufSize) |
|
LE_API_FILESYSTEM le_result_t | le_fs_Seek (le_fs_FileRef_t fileRef, int32_t offset, le_fs_Position_t position, int32_t *currentOffsetPtr) |
|
LE_API_FILESYSTEM le_result_t | le_fs_GetSize (const char *filePath, size_t *sizePtr) |
|
LE_API_FILESYSTEM le_result_t | le_fs_Delete (const char *filePath) |
|
LE_API_FILESYSTEM le_result_t | le_fs_Move (const char *srcPath, const char *destPath) |
|
LE_API_FILESYSTEM le_result_t | le_fs_RemoveDirRecursive (const char *dirPathPtr) |
|
LE_API_FILESYSTEM bool | le_fs_Exists (const char *filePathPtr) |
|
LE_FULL_API LE_API_FILESYSTEM le_result_t | le_fs_GetExecutablePath (char *dirPathPtr, size_t dirPathSize, char *exeNamePtr, size_t exeNameSize) |
|
◆ LE_FS_ACCESS_MODE_MAX
#define LE_FS_ACCESS_MODE_MAX 127 |
Define the maximal bit mask for file access mode.
- Note
- This maximal value should be coherent with le_fs_AccessMode_t
◆ LE_FS_RDONLY
◆ LE_FS_WRONLY
◆ LE_FS_RDWR
◆ LE_FS_CREAT
◆ LE_FS_TRUNC
◆ LE_FS_APPEND
#define LE_FS_APPEND 0x20 |
◆ LE_FS_SYNC
◆ le_fs_AccessMode_t
File access modes used when opening a file.
◆ le_fs_FileRef_t
◆ le_fs_Position_t
Offset position used when seeking in a file.
Enumerator |
---|
LE_FS_SEEK_SET | From the current position.
|
LE_FS_SEEK_CUR | From the beginning of the file.
|
LE_FS_SEEK_END | From the end of the file.
|
◆ le_fs_Open()
This function is called to create or open an existing file.
- Returns
- LE_OK The function succeeded.
- LE_BAD_PARAMETER A parameter is invalid.
- LE_OVERFLOW The file path is too long.
- LE_NOT_FOUND The file does not exists or a directory in the path does not exist
- LE_NOT_PERMITTED Access denied to the file or to a directory in the path
- LE_UNSUPPORTED The prefix cannot be added and the function is unusable
- LE_FAULT The function failed.
- Parameters
-
[in] | filePath | File path |
[in] | accessMode | Access mode for the file |
[out] | fileRefPtr | File reference (if successful) |
◆ le_fs_Close()
This function is called to close an opened file.
- Returns
- LE_OK The function succeeded.
- LE_FAULT The function failed.
- Parameters
-
[in] | fileRef | File reference |
◆ le_fs_Read()
This function is called to read the requested data length from an opened file. The data is read at the current file position.
- Returns
- LE_OK The function succeeded.
- LE_BAD_PARAMETER A parameter is invalid.
- LE_FAULT The function failed.
- Parameters
-
[in] | fileRef | File reference |
[out] | bufPtr | Buffer to store the data read in the file |
[in,out] | bufSizePtr | Size to read and size really read on file |
◆ le_fs_Write()
This function is called to write the requested data length to an opened file. The data is written at the current file position.
- Returns
- LE_OK The function succeeded.
- LE_BAD_PARAMETER A parameter is invalid.
- LE_UNDERFLOW The write succeed but was not able to write all bytes
- LE_FAULT The function failed.
- Parameters
-
[in] | fileRef | File reference |
[in] | bufPtr | Buffer to write in the file |
[in] | bufSize | Size of the buffer to write |
◆ le_fs_Seek()
This function is called to change the file position of an opened file.
- Returns
- LE_OK The function succeeded.
- LE_BAD_PARAMETER A parameter is invalid.
- LE_FAULT The function failed.
- Parameters
-
[in] | fileRef | File reference |
[in] | offset | Offset to apply |
[in] | position | Offset is relative to this position |
[out] | currentOffsetPtr | Offset from the beginning after the seek operation |
◆ le_fs_GetSize()
This function is called to get the size of a file.
- Returns
- LE_OK The function succeeded.
- LE_BAD_PARAMETER A parameter is invalid.
- LE_OVERFLOW The file path is too long.
- LE_UNSUPPORTED The prefix cannot be added and the function is unusable
- LE_FAULT The function failed.
- Parameters
-
[in] | filePath | File path |
[out] | sizePtr | File size (if successful) |
◆ le_fs_Delete()
This function is called to delete a file.
- Returns
- LE_OK The function succeeded.
- LE_BAD_PARAMETER A parameter is invalid.
- LE_OVERFLOW The file path is too long.
- LE_NOT_FOUND The file does not exist or a directory in the path does not exist
- LE_NOT_PERMITTED The access right fails to delete the file or access is not granted to a a directory in the path
- LE_UNSUPPORTED The prefix cannot be added and the function is unusable
- LE_FAULT The function failed.
- Parameters
-
◆ le_fs_Move()
This function is called to rename an existing file. If rename fails, the file will keep its original name.
- Returns
- LE_OK The function succeeded.
- LE_BAD_PARAMETER A parameter is invalid.
- LE_OVERFLOW A file path is too long.
- LE_FAULT The function failed.
- Parameters
-
[in] | srcPath | Path to file to rename |
[in] | destPath | New path to file |
◆ le_fs_RemoveDirRecursive()
Removes a directory located at storage managed by file system service by first recursively removing sub-directories, files, symlinks, hardlinks, devices, etc. Symlinks are not followed, only the links themselves are deleted.
A file or device may not be able to be removed if it is busy, in which case an error message is logged and LE_FAULT is returned.
- Returns
- LE_OK The function succeeded.
- LE_BAD_PARAMETER A parameter is invalid.
- LE_UNSUPPORTED The prefix cannot be added and the function is unusable
- LE_FAULT There is an error.
- Parameters
-
[in] | dirPathPtr | Directory path |
◆ le_fs_Exists()
This function checks whether a regular file exists at the provided path under file system service storage.
- Returns
- true If file exists and it is a regular file.
- false Otherwise.
- Parameters
-
◆ le_fs_GetExecutablePath()
Obtain the absolute directory containing the running executable and the name of the executable.
- Returns
- LE_OK on success or an appropriate error on failure.
- Parameters
-
[out] | dirPathPtr | Buffer to put executable's directory path in. |
[in] | dirPathSize | Size of the directory path buffer. |
[out] | exeNamePtr | Buffer to put the executable's name in. |
[in] | exeNameSize | Size of the executable name buffer. |