mikroSDK Reference Manual
fs_port_rl_fs.h
Go to the documentation of this file.
1
29#ifndef _FS_PORT_RL_FS_H
30#define _FS_PORT_RL_FS_H
31
32//Dependencies
33#include "os_port.h"
34#include "rl_fs.h"
35
36//Maximum path length
37#ifndef FS_MAX_PATH_LEN
38 #define FS_MAX_PATH_LEN 260
39#elif (FS_MAX_PATH_LEN < 1)
40 #error FS_MAX_PATH_LEN parameter is not valid
41#endif
42
43//C++ guard
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48
53typedef void FsFile;
54
55
60typedef struct
61{
62 char_t pattern[FS_MAX_PATH_LEN + 1];
63 fsFileInfo fileInfo;
64} FsDir;
65
66
67//File system abstraction layer
68error_t fsInit(void);
69
70bool_t fsFileExists(const char_t *path);
71error_t fsGetFileSize(const char_t *path, uint32_t *size);
72error_t fsGetFileStat(const char_t *path, FsFileStat *fileStat);
73error_t fsRenameFile(const char_t *oldPath, const char_t *newPath);
74error_t fsDeleteFile(const char_t *path);
75
76FsFile *fsOpenFile(const char_t *path, uint_t mode);
77error_t fsSeekFile(FsFile *file, int_t offset, uint_t origin);
78error_t fsWriteFile(FsFile *file, void *data, size_t length);
79error_t fsReadFile(FsFile *file, void *data, size_t size, size_t *length);
80void fsCloseFile(FsFile *file);
81
82bool_t fsDirExists(const char_t *path);
83error_t fsCreateDir(const char_t *path);
84error_t fsRemoveDir(const char_t *path);
85
86FsDir *fsOpenDir(const char_t *path);
87error_t fsReadDir(FsDir *dir, FsDirEntry *dirEntry);
88void fsCloseDir(FsDir *dir);
89
90//C++ guard
91#ifdef __cplusplus
92}
93#endif
94
95#endif
error_t
Error codes.
Definition error.h:43
void FsFile
File descriptor.
Definition fs_port_fatfs.h:60
void FsDir
Directory descriptor.
Definition fs_port_fatfs.h:67
void FsFile
File descriptor.
Definition fs_port_rl_fs.h:53
RTOS abstraction layer.
Directory entry.
Definition fs_port.h:108
Directory descriptor.
Definition fs_port_posix.h:60
File status.
Definition fs_port.h:96