TuyaOS
函数
tal_fs.h 文件参考

Common process - Initialization 更多...

#include "tuya_cloud_types.h"
tal_fs.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

函数

INT_T tal_dir_close (TUYA_DIR dir)
 Close directory 更多...
 
INT_T tal_dir_is_directory (TUYA_FILEINFO info, BOOL_T *is_dir)
 Check whether the node is a 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_dir_name (TUYA_FILEINFO info, CONST CHAR_T **name)
 Get the name of the file node 更多...
 
INT_T tal_dir_open (CONST CHAR_T *path, TUYA_DIR *dir)
 Open directory 更多...
 
INT_T tal_dir_read (TUYA_DIR dir, TUYA_FILEINFO *info)
 Read directory 更多...
 
INT_T tal_faccess (IN CONST CHAR_T *filepath, IN INT_T mode)
 Judge if the file can be access 更多...
 
INT_T tal_fclose (TUYA_FILE file)
 Close file 更多...
 
INT_T tal_feof (TUYA_FILE file)
 Check wheather to reach the end fo the file 更多...
 
INT_T tal_fflush (IN TUYA_FILE file)
 flush the IO read/write stream 更多...
 
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_fgetsize (IN CONST CHAR_T *filepath)
 Get file size 更多...
 
INT_T tal_fileno (IN TUYA_FILE file)
 get the file fd 更多...
 
TUYA_FILE tal_fopen (CONST CHAR_T *path, CONST CHAR_T *mode)
 Open file 更多...
 
INT_T tal_fread (VOID_T *buf, INT_T bytes, TUYA_FILE file)
 Read 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_fs_remove (CONST CHAR_T *path)
 Remove directory 更多...
 
INT_T tal_fs_rename (CONST CHAR_T *path_old, CONST CHAR_T *path_new)
 File rename 更多...
 
INT_T tal_fseek (TUYA_FILE file, INT64_T offs, INT_T whence)
 Seek to the offset position of the file 更多...
 
INT_T tal_fsync (INT_T fd)
 write buffer to flash 更多...
 
INT64_T tal_ftell (TUYA_FILE file)
 Get current position of file 更多...
 
INT_T tal_ftruncate (INT_T fd, UINT64_T length)
 truncate one file according to the length 更多...
 
INT_T tal_fwrite (VOID_T *buf, INT_T bytes, TUYA_FILE file)
 write file 更多...
 

详细描述

Common process - Initialization

版本
0.1
日期
2021-09-09

函数说明

◆ tal_dir_close()

INT_T tal_dir_close ( TUYA_DIR  dir)

Close directory

参数
[in]dirhandle of directory
注解
This API is used to close a directory
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_dir_is_directory()

INT_T tal_dir_is_directory ( TUYA_FILEINFO  info,
BOOL_T *  is_dir 
)

Check whether the node is a directory

参数
[in]infofile information
[out]is_diris directory or not
注解
This API is used to check whether the node is a directory.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_dir_is_regular()

INT_T tal_dir_is_regular ( TUYA_FILEINFO  info,
BOOL_T *  is_regular 
)

Check whether the node is a normal file

参数
[in]infofile information
[out]is_regularis normal file or not
注解
This API is used to check whether the node is a normal file.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_dir_name()

INT_T tal_dir_name ( TUYA_FILEINFO  info,
CONST CHAR_T **  name 
)

Get the name of the file node

参数
[in]infofile information
[out]namefile name
注解
This API is used to get the name of the file node.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_dir_open()

INT_T tal_dir_open ( CONST CHAR_T *  path,
TUYA_DIR *  dir 
)

Open directory

参数
[in]pathpath of directory
[out]dirhandle of directory
注解
This API is used to open a directory
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_dir_read()

INT_T tal_dir_read ( TUYA_DIR  dir,
TUYA_FILEINFO *  info 
)

Read directory

参数
[in]dirhandle of directory
[out]infofile information
注解
This API is used to read a directory. Read the file information of the current node, and the internal pointer points to the next node.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_faccess()

INT_T tal_faccess ( IN CONST CHAR_T *  filepath,
IN INT_T  mode 
)

Judge if the file can be access

参数
[in]filepathfile path + file name
[in]modeaccess mode
注解
This API is used to access one file.
返回
0 success,-1 failed

◆ tal_fclose()

INT_T tal_fclose ( TUYA_FILE  file)

Close file

参数
[in]filefile handle
注解
This API is used to close a file
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_feof()

INT_T tal_feof ( TUYA_FILE  file)

Check wheather to reach the end fo the file

参数
[in]filefile handle
注解
This API is used to check wheather to reach the end fo the file
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_fflush()

INT_T tal_fflush ( IN TUYA_FILE  file)

flush the IO read/write stream

参数
[in]filechar stream
注解
This API is used to flush the IO read/write stream.
返回
0 success,-1 failed

◆ tal_fgetc()

INT_T tal_fgetc ( IN TUYA_FILE  file)

read the next character from stream

参数
[in]filechar stream
注解
This API is used to get one char from stream.
返回
as an unsigned char cast to a int ,or EOF on end of file or error

◆ tal_fgets()

CHAR_T * tal_fgets ( CHAR_T *  buf,
INT_T  len,
TUYA_FILE  file 
)

Read string from file

参数
[in]bufbuffer for reading file
[in]lenbuffer size
[in]filefile handle
注解
This API is used to read string from file
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_fgetsize()

INT_T tal_fgetsize ( IN CONST CHAR_T *  filepath)

Get file size

参数
[in]filepathfile path + file name
注解
This API is used to get the size of file.
返回
the sizeof of file

◆ tal_fileno()

INT_T tal_fileno ( IN TUYA_FILE  file)

get the file fd

参数
[in]filechar stream
注解
This API is used to get the file fd.
返回
the file fd

◆ tal_fopen()

TUYA_FILE tal_fopen ( CONST CHAR_T *  path,
CONST CHAR_T *  mode 
)

Open file

参数
[in]pathpath of file
[in]modefile open mode: "r","w"...
注解
This API is used to open a file
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_fread()

INT_T tal_fread ( VOID_T *  buf,
INT_T  bytes,
TUYA_FILE  file 
)

Read file

参数
[in]bufbuffer for reading file
[in]bytesbuffer size
[in]filefile handle
注解
This API is used to read a file
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_fs_is_exist()

INT_T tal_fs_is_exist ( CONST CHAR_T *  path,
BOOL_T *  is_exist 
)

Check whether the file or directory exists

参数
[in]pathpath of directory
[out]is_existthe file or directory exists or not
注解
This API is used to check whether the file or directory exists.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_fs_mkdir()

INT_T tal_fs_mkdir ( CONST CHAR_T *  path)

Make directory

参数
[in]pathpath of directory
注解
This API is used for making a directory
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_fs_mode()

INT_T tal_fs_mode ( CONST CHAR_T *  path,
UINT_T *  mode 
)

Get file mode

参数
[in]pathpath of directory
[out]modebit attibute of directory
注解
This API is used for getting file mode.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_fs_remove()

INT_T tal_fs_remove ( CONST CHAR_T *  path)

Remove directory

参数
[in]pathpath of directory
注解
This API is used for removing a directory
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_fs_rename()

INT_T tal_fs_rename ( CONST CHAR_T *  path_old,
CONST CHAR_T *  path_new 
)

File rename

参数
[in]path_oldold path of directory
[in]path_newnew path of directory
注解
This API is used to rename the file.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_fseek()

INT_T tal_fseek ( TUYA_FILE  file,
INT64_T  offs,
INT_T  whence 
)

Seek to the offset position of the file

参数
[in]filefile handle
[in]offsoffset
[in]whenceseek start point mode
注解
This API is used to seek to the offset position of the file.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_fsync()

INT_T tal_fsync ( INT_T  fd)

write buffer to flash

参数
[in]fdfile fd
注解
This API is used to write buffer to flash
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_ftell()

INT64_T tal_ftell ( TUYA_FILE  file)

Get current position of file

参数
[in]filefile handle
注解
This API is used to get current position of file.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_ftruncate()

INT_T tal_ftruncate ( INT_T  fd,
UINT64_T  length 
)

truncate one file according to the length

参数
[in]fdfile description
[in]lengththe length want to truncate
注解
This API is used to truncate one file.
返回
0 success,-1 failed

◆ tal_fwrite()

INT_T tal_fwrite ( VOID_T *  buf,
INT_T  bytes,
TUYA_FILE  file 
)

write file

参数
[in]bufbuffer for writing file
[in]bytesbuffer size
[in]filefile handle
注解
This API is used to write a file
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h