|
PebbleOS v4.44.0-105-g1dd754433
|
Operations of a file system format. More...
#include <fs_sys.h>
Data Fields | |
| int(* | open )(struct pbl_fs_file *file, const char *name, uint32_t flags) |
Open name with PBL_FS_O_* flags; set struct pbl_fs_file::filep and name. | |
| ssize_t(* | read )(struct pbl_fs_file *file, void *buf, size_t len) |
Read up to len bytes at the current position. | |
| ssize_t(* | write )(struct pbl_fs_file *file, const void *buf, size_t len) |
Write len bytes at the current position. | |
| off_t(* | lseek )(struct pbl_fs_file *file, off_t offset, int whence) |
| Move the current position. | |
| off_t(* | tell )(struct pbl_fs_file *file) |
| Get the current position. | |
| off_t(* | size )(struct pbl_fs_file *file) |
| Get the size of the file. | |
| int(* | truncate )(struct pbl_fs_file *file, off_t length) |
| Set the size of the file. | |
| int(* | sync )(struct pbl_fs_file *file) |
| Flush cached data to the storage. | |
| int(* | close )(struct pbl_fs_file *file) |
| Close the file. | |
| int(* | opendir )(struct pbl_fs_dir *dir, const char *name) |
Open directory name; set struct pbl_fs_dir::dirp. | |
| int(* | readdir )(struct pbl_fs_dir *dir, struct pbl_fs_dirent *entry) |
| Read the next entry; an empty name marks the end. | |
| int(* | closedir )(struct pbl_fs_dir *dir) |
| Close the directory. | |
| int(* | mount )(struct pbl_fs_mount *mp) |
| Mount the file system. | |
| int(* | unmount )(struct pbl_fs_mount *mp) |
| Unmount the file system. | |
| int(* | format )(struct pbl_fs_mount *mp) |
| Erase the file system, invalidating every open file. | |
| int(* | unlink )(struct pbl_fs_mount *mp, const char *name) |
| Remove a file. | |
| int(* | rename )(struct pbl_fs_mount *mp, const char *from, const char *to) |
| Rename a file. | |
| int(* | mkdir )(struct pbl_fs_mount *mp, const char *name) |
| Create a directory. | |
| int(* | stat )(struct pbl_fs_mount *mp, const char *name, struct pbl_fs_dirent *entry) |
| Get the type and size of a file. | |
| int(* | statvfs )(struct pbl_fs_mount *mp, const char *name, struct pbl_fs_statvfs *stat) |
| Get the space of the file system. | |
Operations of a file system format.
Every operation returns 0 (or a count or offset) on success and a negative errno on failure. Operations a format does not support may be NULL; the core returns -ENOTSUP for them.
| int(* pbl_fs_ops::close) (struct pbl_fs_file *file) |
Close the file.
| int(* pbl_fs_ops::closedir) (struct pbl_fs_dir *dir) |
Close the directory.
| int(* pbl_fs_ops::format) (struct pbl_fs_mount *mp) |
Erase the file system, invalidating every open file.
| off_t(* pbl_fs_ops::lseek) (struct pbl_fs_file *file, off_t offset, int whence) |
Move the current position.
| int(* pbl_fs_ops::mkdir) (struct pbl_fs_mount *mp, const char *name) |
Create a directory.
| int(* pbl_fs_ops::mount) (struct pbl_fs_mount *mp) |
Mount the file system.
| int(* pbl_fs_ops::open) (struct pbl_fs_file *file, const char *name, uint32_t flags) |
Open name with PBL_FS_O_* flags; set struct pbl_fs_file::filep and name.
| int(* pbl_fs_ops::opendir) (struct pbl_fs_dir *dir, const char *name) |
Open directory name; set struct pbl_fs_dir::dirp.
| ssize_t(* pbl_fs_ops::read) (struct pbl_fs_file *file, void *buf, size_t len) |
Read up to len bytes at the current position.
| int(* pbl_fs_ops::readdir) (struct pbl_fs_dir *dir, struct pbl_fs_dirent *entry) |
Read the next entry; an empty name marks the end.
| int(* pbl_fs_ops::rename) (struct pbl_fs_mount *mp, const char *from, const char *to) |
Rename a file.
| off_t(* pbl_fs_ops::size) (struct pbl_fs_file *file) |
Get the size of the file.
| int(* pbl_fs_ops::stat) (struct pbl_fs_mount *mp, const char *name, struct pbl_fs_dirent *entry) |
Get the type and size of a file.
| int(* pbl_fs_ops::statvfs) (struct pbl_fs_mount *mp, const char *name, struct pbl_fs_statvfs *stat) |
Get the space of the file system.
| int(* pbl_fs_ops::sync) (struct pbl_fs_file *file) |
Flush cached data to the storage.
| off_t(* pbl_fs_ops::tell) (struct pbl_fs_file *file) |
Get the current position.
| int(* pbl_fs_ops::truncate) (struct pbl_fs_file *file, off_t length) |
Set the size of the file.
| int(* pbl_fs_ops::unlink) (struct pbl_fs_mount *mp, const char *name) |
Remove a file.
| int(* pbl_fs_ops::unmount) (struct pbl_fs_mount *mp) |
Unmount the file system.
| ssize_t(* pbl_fs_ops::write) (struct pbl_fs_file *file, const void *buf, size_t len) |
Write len bytes at the current position.