version_2.0
Dependents: cc3000_ping_demo_try_2
Fork of mbed by
FileSystemLike Class Reference
A filesystem-like object is one that can be used to open files though it by fopen("/name/filename", mode) More...
#include <FileSystemLike.h>
Inherits mbed::FileBase.
Inherited by LocalFileSystem.
Public Member Functions | |
FileSystemLike (const char *name) | |
FileSystemLike constructor. | |
virtual FileHandle * | open (const char *filename, int flags)=0 |
Opens a file from the filesystem. | |
virtual int | remove (const char *filename) |
Remove a file from the filesystem. | |
virtual int | rename (const char *oldname, const char *newname) |
Rename a file in the filesystem. | |
virtual DirHandle * | opendir (const char *name) |
Opens a directory in the filesystem and returns a DirHandle representing the directory stream. | |
virtual int | mkdir (const char *name, mode_t mode) |
Creates a directory in the filesystem. |
Detailed Description
A filesystem-like object is one that can be used to open files though it by fopen("/name/filename", mode)
Implementations must define at least open (the default definitions of the rest of the functions just return error values).
Definition at line 33 of file FileSystemLike.h.
Constructor & Destructor Documentation
FileSystemLike | ( | const char * | name ) |
FileSystemLike constructor.
- Parameters:
-
name The name to use for the filesystem.
Member Function Documentation
virtual int mkdir | ( | const char * | name, |
mode_t | mode | ||
) | [virtual] |
Creates a directory in the filesystem.
- Parameters:
-
name The name of the directory to create. mode The permissions to create the directory with.
- Returns:
- 0 on success, -1 on failure.
Definition at line 97 of file FileSystemLike.h.
virtual FileHandle* open | ( | const char * | filename, |
int | flags | ||
) | [pure virtual] |
Opens a file from the filesystem.
- Parameters:
-
filename The name of the file to open. flags One of O_RDONLY, O_WRONLY, or O_RDWR, OR'd with zero or more of O_CREAT, O_TRUNC, or O_APPEND.
- Returns:
- A pointer to a FileHandle object representing the file on success, or NULL on failure.
Implemented in LocalFileSystem.
virtual DirHandle* opendir | ( | const char * | name ) | [virtual] |
Opens a directory in the filesystem and returns a DirHandle representing the directory stream.
- Parameters:
-
name The name of the directory to open.
- Returns:
- A DirHandle representing the directory stream, or NULL on failure.
Reimplemented in LocalFileSystem.
Definition at line 86 of file FileSystemLike.h.
virtual int remove | ( | const char * | filename ) | [virtual] |
Remove a file from the filesystem.
- Parameters:
-
filename the name of the file to remove. returns 0 on success, -1 on failure.
Reimplemented in LocalFileSystem.
Definition at line 64 of file FileSystemLike.h.
virtual int rename | ( | const char * | oldname, |
const char * | newname | ||
) | [virtual] |
Rename a file in the filesystem.
- Parameters:
-
oldname the name of the file to rename. newname the name to rename it to.
- Returns:
- 0 on success, -1 on failure.
Definition at line 75 of file FileSystemLike.h.
Generated on Thu Jul 14 2022 10:44:07 by 1.7.2