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