FAT12, FAT16, FAT32 and, with CONFIG_FATFS_EXFAT, exFAT file systems on disks.
More...
|
| int | pbl_fs_fat_mkfs (const struct pbl_disk *disk, const char *label) |
| | Create an empty FAT file system on a disk that is not mounted.
|
| |
FAT12, FAT16, FAT32 and, with CONFIG_FATFS_EXFAT, exFAT file systems on disks.
A mount takes the disk in struct pbl_fs_mount::fs_data; the disk holds the file system on its own, without a partition table; pbl_fs_mount() fails with -ENODEV when it holds none, and with -ENOTSUP when its sectors are larger than CONFIG_FATFS_MAX_SECTOR_SIZE. Paths below a mount are at most 255 bytes.
- Files grow as they are written; the space pbl_fs_truncate() or a seek past the end of a file opened for writing adds reads as zeros.
- PBL_FS_O_REPLACE is not supported.
- A file open for writing cannot be opened again, removed or renamed (
-EBUSY).
- Renaming over a file removes it first.
- Timestamps are UTC.
- The host and the device must not use a file system at the same time, such as over USB mass storage.
};
if (ret == 0) {
}
const struct pbl_disk pbl_disk_ram
A disk in RAM, of CONFIG_DISK_RAM_SIZE KiB in 512-byte sectors, zeroed at boot.
int pbl_fs_fat_mkfs(const struct pbl_disk *disk, const char *label)
Create an empty FAT file system on a disk that is not mounted.
const struct pbl_fs_ops pbl_fs_fat_ops
FAT format, for struct pbl_fs_mount::ops.
const char * mnt_point
Mount point: "/", or an absolute path without a trailing '/', such as "/sdcard".
Definition fs_sys.h:86
A mounted file system.
Definition fs_sys.h:84
◆ pbl_fs_fat_mkfs()
| int pbl_fs_fat_mkfs |
( |
const struct pbl_disk * |
disk, |
|
|
const char * |
label |
|
) |
| |
Create an empty FAT file system on a disk that is not mounted.
The type and cluster size follow from the size of the disk. pbl_fs_format() does the same on a mounted disk, without a label. Requires CONFIG_FATFS_MKFS.
- Parameters
-
| disk | Disk. |
| label | Volume label, or NULL for none. |
- Return values
-
| -EBUSY | The disk is mounted. |
| -EINVAL | The disk is too small or too large, or label is not a valid label. |
| -ENOTSUP | The sectors of the disk are larger than CONFIG_FATFS_MAX_SECTOR_SIZE. |
| -EROFS | The disk is read-only. |
- Returns
- Other negative errno on failure.
◆ pbl_fs_fat_ops