TuyaOS
tkl_fs.h
浏览该文件的文档.
1
10#ifndef __TKL_FS_H__
11#define __TKL_FS_H__
12
13
14#include "tuya_cloud_types.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20/********************************************************************************
21 *********************************tuya_os_fs_intf********************************
22 ********************************************************************************/
23
33INT_T tkl_fs_mkdir(CONST CHAR_T* path);
34
44INT_T tkl_fs_remove(CONST CHAR_T* path);
45
46
57INT_T tkl_fs_mode(CONST CHAR_T* path, UINT_T* mode);
58
69INT_T tkl_fs_is_exist(CONST CHAR_T* path, BOOL_T* is_exist);
70
81INT_T tkl_fs_rename(CONST CHAR_T* path_old, CONST CHAR_T* path_new);
82
93INT_T tkl_dir_open(CONST CHAR_T* path, TUYA_DIR* dir);
94
104INT_T tkl_dir_close(TUYA_DIR dir);
105
106
118INT_T tkl_dir_read(TUYA_DIR dir, TUYA_FILEINFO* info);
119
130INT_T tkl_dir_name(TUYA_FILEINFO info, CONST CHAR_T** name);
131
142INT_T tkl_dir_is_directory(TUYA_FILEINFO info, BOOL_T* is_dir);
143
154INT_T tkl_dir_is_regular(TUYA_FILEINFO info, BOOL_T* is_regular);
155
166TUYA_FILE tkl_fopen(CONST CHAR_T* path, CONST CHAR_T* mode);
167
177INT_T tkl_fclose(TUYA_FILE file);
178
190INT_T tkl_fread(VOID_T* buf, INT_T bytes, TUYA_FILE file);
191
203INT_T tkl_fwrite(VOID_T* buf, INT_T bytes, TUYA_FILE file);
204
214INT_T tkl_fsync(INT_T fd);
215
227CHAR_T* tkl_fgets(CHAR_T* buf, INT_T len, TUYA_FILE file);
228
238INT_T tkl_feof(TUYA_FILE file);
239
251INT_T tkl_fseek(TUYA_FILE file, INT64_T offs, INT_T whence);
252
262INT64_T tkl_ftell(TUYA_FILE file);
263
273INT_T tkl_fgetsize(CONST CHAR_T *filepath);
274
286INT_T tkl_faccess(CONST CHAR_T *filepath, INT_T mode);
287
297INT_T tkl_fgetc(TUYA_FILE file);
298
308INT_T tkl_fflush(TUYA_FILE file);
309
319INT_T tkl_fileno(TUYA_FILE file);
320
321
333INT_T tkl_ftruncate(INT_T fd, UINT64_T length);
334
335#ifdef __cplusplus
336} // extern "C"
337#endif /* __cplusplus */
338
339#endif //
340
INT_T tkl_fs_mkdir(CONST CHAR_T *path)
Make directory
INT_T tkl_fileno(TUYA_FILE file)
get the file fd
INT_T tkl_dir_close(TUYA_DIR dir)
Close directory
INT_T tkl_fgetc(TUYA_FILE file)
read the next character from stream
INT_T tkl_dir_is_regular(TUYA_FILEINFO info, BOOL_T *is_regular)
Check whether the node is a normal file
INT_T tkl_fs_mode(CONST CHAR_T *path, UINT_T *mode)
Get file mode
INT64_T tkl_ftell(TUYA_FILE file)
Get current position of file
INT_T tkl_fseek(TUYA_FILE file, INT64_T offs, INT_T whence)
Seek to the offset position of the file
INT_T tkl_fclose(TUYA_FILE file)
Close file
INT_T tkl_dir_open(CONST CHAR_T *path, TUYA_DIR *dir)
Open directory
INT_T tkl_ftruncate(INT_T fd, UINT64_T length)
truncate one file according to the length
INT_T tkl_fsync(INT_T fd)
write buffer to flash
TUYA_FILE tkl_fopen(CONST CHAR_T *path, CONST CHAR_T *mode)
Open file
INT_T tkl_dir_name(TUYA_FILEINFO info, CONST CHAR_T **name)
Get the name of the file node
INT_T tkl_dir_read(TUYA_DIR dir, TUYA_FILEINFO *info)
Read directory
INT_T tkl_faccess(CONST CHAR_T *filepath, INT_T mode)
Judge if the file can be access
INT_T tkl_fs_remove(CONST CHAR_T *path)
Remove directory
CHAR_T * tkl_fgets(CHAR_T *buf, INT_T len, TUYA_FILE file)
Read string from file
INT_T tkl_feof(TUYA_FILE file)
Check wheather to reach the end fo the file
INT_T tkl_dir_is_directory(TUYA_FILEINFO info, BOOL_T *is_dir)
Check whether the node is a directory
INT_T tkl_fflush(TUYA_FILE file)
flush the IO read/write stream
INT_T tkl_fread(VOID_T *buf, INT_T bytes, TUYA_FILE file)
Read file
INT_T tkl_fs_rename(CONST CHAR_T *path_old, CONST CHAR_T *path_new)
File rename
INT_T tkl_fgetsize(CONST CHAR_T *filepath)
Get file size
INT_T tkl_fs_is_exist(CONST CHAR_T *path, BOOL_T *is_exist)
Check whether the file or directory exists
INT_T tkl_fwrite(VOID_T *buf, INT_T bytes, TUYA_FILE file)
write file