1 Star 0 Fork 4.9K

wenjun / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
osal_file-h.md 13.19 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

osal_file.h

Overview

Related Modules:

OSAL

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.

1
https://gitee.com/wenjun_flyingfox/docs.git
git@gitee.com:wenjun_flyingfox/docs.git
wenjun_flyingfox
docs
docs
master

搜索帮助