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.
Fork of mbed-src 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.
Definition at line 65 of file FileSystemLike.cpp.
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 Tue Jul 12 2022 16:30:33 by
