加入收藏
举报
02-14 20:02
#0
文件名称:
osal_file-h.md
所在目录:
Openharmony v1.0 / docs / api / api-SmartVision-Devices
文件大小:
13.19 KB
下载地址:
fenwii/OpenHarmony
   
免责声明:本网站仅提供指向 GitHub 上的文件的链接,所有文件的版权归原作者所有,本网站不对文件内容的合法性、准确性或安全性承担任何责任。
文本预览:
# osal\_file.h
## **Overview**
**Related Modules:**
[OSAL](OSAL.md)
**Description:**
Declares the file structures and interfaces.
This file provides interfaces for opening, closing, reading, and writing a file, and setting the read/write offset.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Data Structures









Data Structure Name


Description


OsalFile


Declares a file type.



## Macros



















































Macro Name and Value


Description


OSAL_O_RD_ONLY   0


Opens a file in read-only mode.


OSAL_O_WR_ONLY   1


Opens a file in write-only mode.


OSAL_O_RDWR   2


Opens a file in read and write mode.


OSAL_S_IREAD   00400


Defines the read permission for the owner.


OSAL_S_IWRITE   00200


Defines the write permission for the owner.


OSAL_S_IEXEC   00100


Defines the execution permission for the owner.


OSAL_S_IRGRP   00040


Defines the read permission for the group.


OSAL_S_IWGRP   00020


Defines the write permission for the group.


OSAL_S_IXGRP   00010


Defines the execution permission for the group.


OSAL_S_IROTH   00004


Defines the read permission for others.


OSAL_S_IWOTH   00002


Defines the write permission for others.


OSAL_S_IXOTH   00001


Defines the execution permission for others.


OSAL_SEEK_SET   0


Defines the offset from the file header.


OSAL_SEEK_CUR   1


Defines the offset from the current position.


OSAL_SEEK_END   2


Defines the offset from the end of the file.



## Functions





















Function Name


Description


OsalFileOpen (OsalFile *file, const char *path, int flags, uint32_t rights)


int32_t 


Opens a file.


OsalFileWrite (OsalFile *file, const void *string, uint32_t length)


ssize_t 


Writes a file.


OsalFileClose (OsalFile *file)


void 


Closes a file.


OsalFileRead (OsalFile *file, void *buf, uint32_t length)


ssize_t 


Reads a file.


OsalFileLseek (OsalFile *file, off_t offset, int32_t whence)


off_t 


Sets the file read/write offset.


点赞 回复
回帖
支持markdown部分语法 ?