WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
osal_fileops

函数

void * osal_klib_fopen (const char *file, int flags, int mode)
 open file and return file pointer.
 
void osal_klib_fclose (void *filp)
 close file.
 
int osal_klib_fwrite (const char *buf, unsigned long size, void *filp)
 kernel write function.
 
int osal_klib_fread (char *buf, unsigned long size, void *filp)
 Kernel read function.
 
void osal_klib_fsync (void *filp)
 Perform a fsync or fdatasync on a file
 
int osal_klib_fseek (long long offset, int whence, void *filp)
 Kernel file seek function.
 
int osal_klib_unlink (const char *path)
 Removes a file or directory.
 
int osal_klib_ftruncate (void *filp, unsigned long len)
 Truncates the size of the file to the specified size.
 

详细描述

函数说明

◆ osal_klib_fclose()

void osal_klib_fclose ( void *  filp)

close file.

参数
filp[in] the result of osal_klib_fopen
Support System:
linux liteos seliteos freertos.

◆ osal_klib_fopen()

void * osal_klib_fopen ( const char *  file,
int  flags,
int  mode 
)

open file and return file pointer.

参数
file[in] the filename of file
flags[in] the opreation flag example: OSAL_O_CREAT
mode[in] the mode example: OSAL_O_RDONLY
返回
void* / null
Support System:
linux liteos seliteos freertos.

◆ osal_klib_fread()

int osal_klib_fread ( char *  buf,
unsigned long  size,
void *  filp 
)

Kernel read function.

参数
buf[out] the buffer you want to read in
size[in] the size of buffer
filp[in] the result of osal_klib_fopen
返回
The length that has been read.
Support System:
linux liteos seliteos freertos.

◆ osal_klib_fseek()

int osal_klib_fseek ( long long  offset,
int  whence,
void *  filp 
)

Kernel file seek function.

参数
offset[in] the new position of file
whence[in] the method of lseek,example:OSAL_SEEK_SET
filp[in] the result of osal_klib_fopen
Support System:
linux liteos seliteos freertos.

◆ osal_klib_fsync()

void osal_klib_fsync ( void *  filp)

Perform a fsync or fdatasync on a file

参数
filp[in] the result of osal_klib_fopen
返回
The value 0 indicates success, and other values indicate failure.
Support System:
linux liteos.

◆ osal_klib_ftruncate()

int osal_klib_ftruncate ( void *  filp,
unsigned long  len 
)

Truncates the size of the file to the specified size.

参数
filp[in] the result of osal_klib_fopen
len[in] the len of ftruncate
返回
The value 0 indicates success, and other values indicate failure.
Support System:
seliteos.

◆ osal_klib_fwrite()

int osal_klib_fwrite ( const char *  buf,
unsigned long  size,
void *  filp 
)

kernel write function.

参数
buf[in] the buffer you want to write
size[in] the size of buffer
filp[in] the result of osal_klib_fopen
返回
The length that has been written.
Support System:
linux liteos seliteos freertos.

◆ osal_klib_unlink()

int osal_klib_unlink ( const char *  path)

Removes a file or directory.

参数
path[in] the file path of file
注意
If removing a directory, the directory must be empty.
返回
The value 0 indicates success, and other values indicate failure.
Support System:
seliteos.