Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
fs_port.h File Reference
File system abstraction layer. More...
Go to the source code of this file.
Data Structures | |
| struct | FsDirEntry |
| Directory entry. More... | |
Typedefs | |
| typedef void | FsFile |
| File handle. | |
| typedef void | FsDir |
| Directory handle. | |
Enumerations | |
| enum | FsFileAttributes |
File attributes. More... | |
| enum | FsFileMode |
File access mode. More... | |
| enum | FsSeekOrigin |
File seek origin. More... | |
Functions | |
| error_t | fsInit (void) |
| File system initialization. | |
| bool_t | fsFileExists (const char_t *path) |
| Check whether a file exists. | |
| error_t | fsGetFileSize (const char_t *path, uint32_t *size) |
| Retrieve the size of the specified file. | |
| error_t | fsRenameFile (const char_t *oldPath, const char_t *newPath) |
| Rename the specified file. | |
| error_t | fsDeleteFile (const char_t *path) |
| Delete a file. | |
| FsFile * | fsOpenFile (const char_t *path, uint_t mode) |
| Open the specified file for reading or writing. | |
| error_t | fsSeekFile (FsFile *file, int_t offset, uint_t origin) |
| Move to specified position in file. | |
| error_t | fsWriteFile (FsFile *file, void *data, size_t length) |
| Write data to the specified file. | |
| error_t | fsReadFile (FsFile *file, void *data, size_t size, size_t *length) |
| Read data from the specified file. | |
| void | fsCloseFile (FsFile *file) |
| Close a file. | |
| bool_t | fsDirExists (const char_t *path) |
| Check whether a directory exists. | |
| error_t | fsCreateDir (const char_t *path) |
| Create a directory. | |
| error_t | fsRemoveDir (const char_t *path) |
| Remove a directory. | |
| FsDir * | fsOpenDir (const char_t *path) |
| Open a directory stream. | |
| error_t | fsReadDir (FsDir *dir, FsDirEntry *dirEntry) |
| Read an entry from the specified directory stream. | |
| void | fsCloseDir (FsDir *dir) |
| Close a directory stream. | |
Detailed Description
File system abstraction layer.
License
Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version:
- 1.7.6
Definition in file fs_port.h.
Typedef Documentation
Enumeration Type Documentation
| enum FsFileAttributes |
| enum FsFileMode |
| enum FsSeekOrigin |
Function Documentation
| void fsCloseDir | ( | FsDir * | dir ) |
Close a directory stream.
- Parameters:
-
[in] dir Handle that identifies the directory to be closed
Definition at line 745 of file fs_port_fatfs.c.
| void fsCloseFile | ( | FsFile * | file ) |
Close a file.
- Parameters:
-
[in] file Handle that identifies the file to be closed
Definition at line 464 of file fs_port_fatfs.c.
| error_t fsCreateDir | ( | const char_t * | path ) |
Create a directory.
- Parameters:
-
[in] path NULL-terminated string specifying the directory path
- Returns:
- Error code
Definition at line 539 of file fs_port_fatfs.c.
| error_t fsDeleteFile | ( | const char_t * | path ) |
Delete a file.
- Parameters:
-
[in] path NULL-terminated string specifying the filename
- Returns:
- Error code
Definition at line 229 of file fs_port_fatfs.c.
| bool_t fsDirExists | ( | const char_t * | path ) |
Check whether a directory exists.
- Parameters:
-
[in] path NULL-terminated string specifying the directory path
- Returns:
- The function returns TRUE if the directory exists. Otherwise FALSE is returned
Definition at line 489 of file fs_port_fatfs.c.
| bool_t fsFileExists | ( | const char_t * | path ) |
Check whether a file exists.
- Parameters:
-
[in] path NULL-terminated string specifying the filename
- Returns:
- The function returns TRUE if the file exists. Otherwise FALSE is returned
Definition at line 96 of file fs_port_fatfs.c.
| error_t fsGetFileSize | ( | const char_t * | path, |
| uint32_t * | size | ||
| ) |
Retrieve the size of the specified file.
- Parameters:
-
[in] path NULL-terminated string specifying the filename [out] size Size of the file in bytes
- Returns:
- Error code
Definition at line 143 of file fs_port_fatfs.c.
| error_t fsInit | ( | void | ) |
| FsDir* fsOpenDir | ( | const char_t * | path ) |
Open a directory stream.
- Parameters:
-
[in] path NULL-terminated string specifying the directory path
- Returns:
- Directory handle
Definition at line 611 of file fs_port_fatfs.c.
| FsFile* fsOpenFile | ( | const char_t * | path, |
| uint_t | mode | ||
| ) |
Open the specified file for reading or writing.
- Parameters:
-
[in] path NULL-terminated string specifying the filename [in] mode Type of access permitted (FS_FILE_MODE_READ, FS_FILE_MODE_WRITE or FS_FILE_MODE_CREATE)
- Returns:
- File handle
Definition at line 267 of file fs_port_fatfs.c.
| error_t fsReadDir | ( | FsDir * | dir, |
| FsDirEntry * | dirEntry | ||
| ) |
Read an entry from the specified directory stream.
- Parameters:
-
[in] dir Handle that identifies the directory [out] dirEntry Pointer to a directory entry
- Returns:
- Error code
Definition at line 658 of file fs_port_fatfs.c.
Read data from the specified file.
- Parameters:
-
[in] file Handle that identifies the file to be read [in] data Pointer to the buffer where to copy the data [in] size Size of the buffer, in bytes [out] length Number of data bytes that have been read
- Returns:
- Error code
Definition at line 419 of file fs_port_fatfs.c.
| error_t fsRemoveDir | ( | const char_t * | path ) |
Remove a directory.
- Parameters:
-
[in] path NULL-terminated string specifying the directory path
- Returns:
- Error code
Definition at line 575 of file fs_port_fatfs.c.
| error_t fsRenameFile | ( | const char_t * | oldPath, |
| const char_t * | newPath | ||
| ) |
Rename the specified file.
- Parameters:
-
[in] oldPath NULL-terminated string specifying the pathname of the file to be renamed [in] newPath NULL-terminated string specifying the new filename
- Returns:
- Error code
Definition at line 193 of file fs_port_fatfs.c.
Move to specified position in file.
- Parameters:
-
[in] file Handle that identifies the file [in] offset Number of bytes to move from origin [in] origin Position used as reference for the offset (FS_SEEK_SET, FS_SEEK_CUR or FS_SEEK_END)
- Returns:
- Error code
Definition at line 330 of file fs_port_fatfs.c.
Write data to the specified file.
- Parameters:
-
[in] file Handle that identifies the file to be written [in] data Pointer to a buffer containing the data to be written [in] length Number of data bytes to write
- Returns:
- Error code
Definition at line 375 of file fs_port_fatfs.c.
Generated on Tue Jul 12 2022 17:10:19 by
1.7.2