TuyaOS
tal_fs.h
浏览该文件的文档.
1
10#ifndef __TAL_FS_H__
11#define __TAL_FS_H__
12
13#include "tuya_cloud_types.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19/********************************************************************************
20 ********************************************************************************
21 ********************************************************************************/
22
23
33INT_T tal_fs_mkdir(CONST CHAR_T* path);
34
44INT_T tal_fs_remove(CONST CHAR_T* path);
45
56INT_T tal_fs_mode(CONST CHAR_T* path, UINT_T* mode);
57
68INT_T tal_fs_is_exist(CONST CHAR_T* path, BOOL_T* is_exist);
69
80INT_T tal_fs_rename(CONST CHAR_T* path_old, CONST CHAR_T* path_new);
81
92INT_T tal_dir_open(CONST CHAR_T* path, TUYA_DIR* dir);
93
103INT_T tal_dir_close(TUYA_DIR dir);
104
116INT_T tal_dir_read(TUYA_DIR dir, TUYA_FILEINFO* info);
117
128INT_T tal_dir_name(TUYA_FILEINFO info, CONST CHAR_T** name);
129
140INT_T tal_dir_is_directory(TUYA_FILEINFO info, BOOL_T* is_dir);
141
153INT_T tal_dir_is_regular(TUYA_FILEINFO info, BOOL_T* is_regular);
154
165TUYA_FILE tal_fopen(CONST CHAR_T* path, CONST CHAR_T* mode);
166
176INT_T tal_fclose(TUYA_FILE file);
177
189INT_T tal_fread(VOID_T* buf, INT_T bytes, TUYA_FILE file);
190
202INT_T tal_fwrite(VOID_T* buf, INT_T bytes, TUYA_FILE file);
203
213INT_T tal_fsync(INT_T fd);
214
226CHAR_T* tal_fgets(CHAR_T* buf, INT_T len, TUYA_FILE file);
227
237INT_T tal_feof(TUYA_FILE file);
238
250INT_T tal_fseek(TUYA_FILE file, INT64_T offs, INT_T whence);
251
261INT64_T tal_ftell(TUYA_FILE file);
262
272INT_T tal_fgetsize(IN CONST CHAR_T *filepath);
273
285INT_T tal_faccess(IN CONST CHAR_T *filepath,IN INT_T mode);
286
296INT_T tal_fgetc(IN TUYA_FILE file);
297
307INT_T tal_fflush(IN TUYA_FILE file);
308
318INT_T tal_fileno(IN TUYA_FILE file);
319
331INT_T tal_ftruncate(INT_T fd, UINT64_T length);
332
333#ifdef __cplusplus
334} // extern "C"
335#endif /* __cplusplus */
336
337#endif
338
INT_T tal_faccess(IN CONST CHAR_T *filepath, IN INT_T mode)
Judge if the file can be access
INT_T tal_fs_remove(CONST CHAR_T *path)
Remove directory
INT_T tal_dir_is_regular(TUYA_FILEINFO info, BOOL_T *is_regular)
Check whether the node is a normal file
INT_T tal_fwrite(VOID_T *buf, INT_T bytes, TUYA_FILE file)
write file
INT_T tal_fseek(TUYA_FILE file, INT64_T offs, INT_T whence)
Seek to the offset position of the file
TUYA_FILE tal_fopen(CONST CHAR_T *path, CONST CHAR_T *mode)
Open file
INT_T tal_fs_is_exist(CONST CHAR_T *path, BOOL_T *is_exist)
Check whether the file or directory exists
INT_T tal_fs_mkdir(CONST CHAR_T *path)
Make directory
INT_T tal_fs_mode(CONST CHAR_T *path, UINT_T *mode)
Get file mode
INT_T tal_dir_name(TUYA_FILEINFO info, CONST CHAR_T **name)
Get the name of the file node
INT64_T tal_ftell(TUYA_FILE file)
Get current position of file
INT_T tal_fclose(TUYA_FILE file)
Close file
INT_T tal_fgetc(IN TUYA_FILE file)
read the next character from stream
CHAR_T * tal_fgets(CHAR_T *buf, INT_T len, TUYA_FILE file)
Read string from file
INT_T tal_ftruncate(INT_T fd, UINT64_T length)
truncate one file according to the length
INT_T tal_fgetsize(IN CONST CHAR_T *filepath)
Get file size
INT_T tal_fflush(IN TUYA_FILE file)
flush the IO read/write stream
INT_T tal_feof(TUYA_FILE file)
Check wheather to reach the end fo the file
INT_T tal_dir_close(TUYA_DIR dir)
Close directory
INT_T tal_fileno(IN TUYA_FILE file)
get the file fd
INT_T tal_dir_is_directory(TUYA_FILEINFO info, BOOL_T *is_dir)
Check whether the node is a directory
INT_T tal_dir_open(CONST CHAR_T *path, TUYA_DIR *dir)
Open directory
INT_T tal_fs_rename(CONST CHAR_T *path_old, CONST CHAR_T *path_new)
File rename
INT_T tal_dir_read(TUYA_DIR dir, TUYA_FILEINFO *info)
Read directory
INT_T tal_fsync(INT_T fd)
write buffer to flash
INT_T tal_fread(VOID_T *buf, INT_T bytes, TUYA_FILE file)
Read file