Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
fs_sys.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_FS_FS_SYS_H_
8#define ZEPHYR_INCLUDE_FS_FS_SYS_H_
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
35 int (*open)(struct fs_file_t *filp, const char *fs_path,
45 ssize_t (*read)(struct fs_file_t *filp, void *dest, size_t nbytes);
54 ssize_t (*write)(struct fs_file_t *filp,
55 const void *src, size_t nbytes);
64 int (*lseek)(struct fs_file_t *filp, off_t off, int whence);
71 off_t (*tell)(struct fs_file_t *filp);
79 int (*truncate)(struct fs_file_t *filp, off_t length);
86 int (*sync)(struct fs_file_t *filp);
93 int (*close)(struct fs_file_t *filp);
107 int (*opendir)(struct fs_dir_t *dirp, const char *fs_path);
115 int (*readdir)(struct fs_dir_t *dirp, struct fs_dirent *entry);
122 int (*closedir)(struct fs_dir_t *dirp);
135 int (*mount)(struct fs_mount_t *mountp);
142 int (*unmount)(struct fs_mount_t *mountp);
150 int (*unlink)(struct fs_mount_t *mountp, const char *name);
159 int (*rename)(struct fs_mount_t *mountp, const char *from,
160 const char *to);
168 int (*mkdir)(struct fs_mount_t *mountp, const char *name);
177 int (*stat)(struct fs_mount_t *mountp, const char *path,
178 struct fs_dirent *entry);
187 int (*statvfs)(struct fs_mount_t *mountp, const char *path,
188 struct fs_statvfs *stat);
189#if defined(CONFIG_FILE_SYSTEM_MKFS) || defined(__DOXYGEN__)
201 int (*mkfs)(uintptr_t dev_id, void *cfg, int flags);
202#endif
204};
205
210#ifdef __cplusplus
211}
212#endif
213
214#endif /* ZEPHYR_INCLUDE_FS_FS_SYS_H_ */
irp nz macro MOVR cc s mov cc s endm endr irp aw macro LDR aa off
Definition asm-macro-32-bit-gnu.h:17
uint8_t fs_mode_t
Definition fs_interface.h:62
__SIZE_TYPE__ ssize_t
Definition types.h:28
__INTPTR_TYPE__ off_t
Definition types.h:36
flags
Definition parser.h:96
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
Directory object representing an open directory.
Definition fs_interface.h:90
Structure to receive file or directory information.
Definition fs.h:117
File System interface structure.
Definition fs_sys.h:22
int(* unmount)(struct fs_mount_t *mountp)
Unmounts a file system.
Definition fs_sys.h:142
int(* lseek)(struct fs_file_t *filp, off_t off, int whence)
Moves the file position to a new location in the file.
Definition fs_sys.h:64
int(* mount)(struct fs_mount_t *mountp)
Mounts a file system.
Definition fs_sys.h:135
ssize_t(* write)(struct fs_file_t *filp, const void *src, size_t nbytes)
Writes nbytes number of bytes.
Definition fs_sys.h:54
int(* mkfs)(uintptr_t dev_id, void *cfg, int flags)
Formats a device to specified file system type.
Definition fs_sys.h:201
int(* unlink)(struct fs_mount_t *mountp, const char *name)
Deletes the specified file or directory.
Definition fs_sys.h:150
int(* statvfs)(struct fs_mount_t *mountp, const char *path, struct fs_statvfs *stat)
Returns the total and available space on the file system volume.
Definition fs_sys.h:187
off_t(* tell)(struct fs_file_t *filp)
Retrieves the current position in the file.
Definition fs_sys.h:71
int(* opendir)(struct fs_dir_t *dirp, const char *fs_path)
Opens an existing directory specified by the path.
Definition fs_sys.h:107
int(* open)(struct fs_file_t *filp, const char *fs_path, fs_mode_t flags)
Opens or creates a file, depending on flags given.
Definition fs_sys.h:35
int(* stat)(struct fs_mount_t *mountp, const char *path, struct fs_dirent *entry)
Checks the status of a file or directory specified by the path.
Definition fs_sys.h:177
int(* truncate)(struct fs_file_t *filp, off_t length)
Truncates/expands the file to the new length.
Definition fs_sys.h:79
ssize_t(* read)(struct fs_file_t *filp, void *dest, size_t nbytes)
Reads nbytes number of bytes.
Definition fs_sys.h:45
int(* mkdir)(struct fs_mount_t *mountp, const char *name)
Creates a new directory using specified path.
Definition fs_sys.h:168
int(* readdir)(struct fs_dir_t *dirp, struct fs_dirent *entry)
Reads directory entries of an open directory.
Definition fs_sys.h:115
int(* closedir)(struct fs_dir_t *dirp)
Closes an open directory.
Definition fs_sys.h:122
int(* sync)(struct fs_file_t *filp)
Flushes the cache of an open file.
Definition fs_sys.h:86
int(* close)(struct fs_file_t *filp)
Flushes the associated stream and closes the file.
Definition fs_sys.h:93
int(* rename)(struct fs_mount_t *mountp, const char *from, const char *to)
Renames a file or directory.
Definition fs_sys.h:159
File object representing an open file.
Definition fs_interface.h:76
File system mount info structure.
Definition fs.h:91
Structure to receive volume statistics.
Definition fs.h:134
Definition stat.h:57