TuyaOS
宏定义
tuya_hal_fs.h 文件参考

Common process - Initialization 更多...

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

浏览源代码.

宏定义

#define tuya_hal_dir_close(dir)   tal_dir_close(dir)
 Close directory 更多...
 
#define tuya_hal_dir_is_directory(info, is_dir)   tal_dir_is_directory(info, is_dir)
 Check whether the node is a directory 更多...
 
#define tuya_hal_dir_is_regular(info, is_regular)   tal_dir_is_regular(info, is_regular)
 Check whether the node is a normal file 更多...
 
#define tuya_hal_dir_name(info, name)   tal_dir_name(info, name)
 Get the name of the file node 更多...
 
#define tuya_hal_dir_open(path, dir)   tal_dir_open(path, dir)
 Open directory 更多...
 
#define tuya_hal_dir_read(dir, info)   tal_dir_read(dir, info)
 Read directory 更多...
 
#define tuya_hal_faccess(Cfilepath, mode)   tal_faccess(Cfilepath, mode)
 Judge if the file can be access 更多...
 
#define tuya_hal_fclose(file)   tal_fclose(file)
 Close file 更多...
 
#define tuya_hal_feof(file)   tal_feof(file)
 Check wheather to reach the end fo the file 更多...
 
#define tuya_hal_fflush(file)   tal_fflush(file)
 flush the IO read/write stream 更多...
 
#define tuya_hal_fgetc(file)   tal_fgetc(file)
 read the next character from stream 更多...
 
#define tuya_hal_fgets(buf, len, file)   tal_fgets(buf, len, file)
 Read string from file 更多...
 
#define tuya_hal_fgetsize(filepath)   tal_fgetsize(filepath)
 Get file size 更多...
 
#define tuya_hal_fileno(file)   tal_fileno(file)
 get the file fd 更多...
 
#define tuya_hal_fopen(path, mode)   tal_fopen(path, mode)
 Open file 更多...
 
#define tuya_hal_fread(buf, bytes, file)   tal_fread(buf, bytes, file)
 Read file 更多...
 
#define tuya_hal_fs_is_exist(path, is_exist)   tal_fs_is_exist(path, is_exist)
 Check whether the file or directory exists 更多...
 
#define tuya_hal_fs_mkdir(path)   tal_fs_mkdir(path)
 Make directory 更多...
 
#define tuya_hal_fs_mode(path, mode)   tal_fs_mode(path, mode)
 Get file mode 更多...
 
#define tuya_hal_fs_remove(path)   tal_fs_remove(path)
 Remove directory 更多...
 
#define tuya_hal_fs_rename(path_old, path_new)   tal_fs_rename(path_old, path_new)
 File rename 更多...
 
#define tuya_hal_fseek(file, offs, whence)   tal_fseek(file, offs, whence)
 Seek to the offset position of the file 更多...
 
#define tuya_hal_fsync(fd)   tal_fsync(fd)
 write buffer to flash 更多...
 
#define tuya_hal_ftell(file)   tal_ftell(file)
 Get current position of file 更多...
 
#define tuya_hal_ftruncate(fd, length)   tal_ftruncate(fd, length)
 truncate one file according to the length 更多...
 
#define tuya_hal_fwrite(buf, bytes, file)   tal_fwrite(buf, bytes, file)
 write file 更多...
 

详细描述

Common process - Initialization

版本
0.1
日期
2021-09-13

宏定义说明

◆ tuya_hal_dir_close

#define tuya_hal_dir_close (   dir)    tal_dir_close(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

◆ tuya_hal_dir_is_directory

#define tuya_hal_dir_is_directory (   info,
  is_dir 
)    tal_dir_is_directory(info, 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

◆ tuya_hal_dir_is_regular

#define tuya_hal_dir_is_regular (   info,
  is_regular 
)    tal_dir_is_regular(info, 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

◆ tuya_hal_dir_name

#define tuya_hal_dir_name (   info,
  name 
)    tal_dir_name(info, 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

◆ tuya_hal_dir_open

#define tuya_hal_dir_open (   path,
  dir 
)    tal_dir_open(path, 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

◆ tuya_hal_dir_read

#define tuya_hal_dir_read (   dir,
  info 
)    tal_dir_read(dir, 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

◆ tuya_hal_faccess

#define tuya_hal_faccess (   Cfilepath,
  mode 
)    tal_faccess(Cfilepath, 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

◆ tuya_hal_fclose

#define tuya_hal_fclose (   file)    tal_fclose(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

◆ tuya_hal_feof

#define tuya_hal_feof (   file)    tal_feof(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

◆ tuya_hal_fflush

#define tuya_hal_fflush (   file)    tal_fflush(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

◆ tuya_hal_fgetc

#define tuya_hal_fgetc (   file)    tal_fgetc(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

◆ tuya_hal_fgets

#define tuya_hal_fgets (   buf,
  len,
  file 
)    tal_fgets(buf, len, 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

◆ tuya_hal_fgetsize

#define tuya_hal_fgetsize (   filepath)    tal_fgetsize(filepath)

Get file size

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

◆ tuya_hal_fileno

#define tuya_hal_fileno (   file)    tal_fileno(file)

get the file fd

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

◆ tuya_hal_fopen

#define tuya_hal_fopen (   path,
  mode 
)    tal_fopen(path, 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

◆ tuya_hal_fread

#define tuya_hal_fread (   buf,
  bytes,
  file 
)    tal_fread(buf, bytes, 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

◆ tuya_hal_fs_is_exist

#define tuya_hal_fs_is_exist (   path,
  is_exist 
)    tal_fs_is_exist(path, 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

◆ tuya_hal_fs_mkdir

#define tuya_hal_fs_mkdir (   path)    tal_fs_mkdir(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

◆ tuya_hal_fs_mode

#define tuya_hal_fs_mode (   path,
  mode 
)    tal_fs_mode(path, 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

◆ tuya_hal_fs_remove

#define tuya_hal_fs_remove (   path)    tal_fs_remove(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

◆ tuya_hal_fs_rename

#define tuya_hal_fs_rename (   path_old,
  path_new 
)    tal_fs_rename(path_old, 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

◆ tuya_hal_fseek

#define tuya_hal_fseek (   file,
  offs,
  whence 
)    tal_fseek(file, offs, 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

◆ tuya_hal_fsync

#define tuya_hal_fsync (   fd)    tal_fsync(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

◆ tuya_hal_ftell

#define tuya_hal_ftell (   file)    tal_ftell(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

◆ tuya_hal_ftruncate

#define tuya_hal_ftruncate (   fd,
  length 
)    tal_ftruncate(fd, 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

◆ tuya_hal_fwrite

#define tuya_hal_fwrite (   buf,
  bytes,
  file 
)    tal_fwrite(buf, bytes, 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