1# raw_file.h 2 3 4## Overview 5 6Provides functions related to rawfiles, including searching for, reading, and closing rawfiles. 7 8**Since**: 8 9 10**Related module**: [Rawfile](rawfile.md) 11 12 13## Summary 14 15 16### Structs 17 18| Name| Description| 19| -------- | -------- | 20| struct [RawFileDescriptor](_raw_file_descriptor.md) | Defines the file descriptor information of a file in the **rawfile** directory. | 21| struct [RawFileDescriptor64](_raw_file_descriptor64.md) | Defines the file descriptor of a large rawfile. | 22 23 24### Types 25 26| Name| Description| 27| -------- | -------- | 28| typedef struct [RawFile](rawfile.md#rawfile)[RawFile](rawfile.md#rawfile) | Provides access to rawfiles. | 29| typedef struct [RawFile64](rawfile.md#rawfile64)[RawFile64](rawfile.md#rawfile64) | Provides access to large rawfiles. | 30 31 32### Function 33 34| Name| Description| 35| -------- | -------- | 36| int [OH_ResourceManager_ReadRawFile](rawfile.md#oh_resourcemanager_readrawfile) (const [RawFile](rawfile.md#rawfile) \*rawFile, void \*buf, size_t length) | Reads data of the specified length from the current position in a rawfile. | 37| int [OH_ResourceManager_SeekRawFile](rawfile.md#oh_resourcemanager_seekrawfile) (const [RawFile](rawfile.md#rawfile) \*rawFile, long offset, int whence) | Searches for the data read/write position in a rawfile based on the specified offset. | 38| long [OH_ResourceManager_GetRawFileSize](rawfile.md#oh_resourcemanager_getrawfilesize) ([RawFile](rawfile.md#rawfile) \*rawFile) | Obtains the length of the rawfile, in long. | 39| long [OH_ResourceManager_GetRawFileRemainingLength](rawfile.md#oh_resourcemanager_getrawfileremaininglength) (const [RawFile](rawfile.md#rawfile) \*rawFile) | Obtains the remaining length of the rawfile, in long. | 40| void [OH_ResourceManager_CloseRawFile](rawfile.md#oh_resourcemanager_closerawfile) ([RawFile](rawfile.md#rawfile) \*rawFile) | Closes a [RawFile](rawfile.md#rawfile) and releases all associated resources. | 41| long [OH_ResourceManager_GetRawFileOffset](rawfile.md#oh_resourcemanager_getrawfileoffset) (const [RawFile](rawfile.md#rawfile) \*rawFile) | Obtains the current offset of a rawfile, in long. | 42| bool [OH_ResourceManager_GetRawFileDescriptor](rawfile.md#oh_resourcemanager_getrawfiledescriptor) (const [RawFile](rawfile.md#rawfile) \*rawFile, [RawFileDescriptor](_raw_file_descriptor.md) &descriptor) | Opens a rawfile based on the specified offset (in long) and file length (in long) and obtains the file descriptor. | 43| bool [OH_ResourceManager_ReleaseRawFileDescriptor](rawfile.md#oh_resourcemanager_releaserawfiledescriptor) (const [RawFileDescriptor](_raw_file_descriptor.md) &descriptor) | Releases a file descriptor. | 44| int64_t [OH_ResourceManager_ReadRawFile64](rawfile.md#oh_resourcemanager_readrawfile64) (const [RawFile64](rawfile.md#rawfile64) \*rawFile, void \*buf, int64_t length) | Reads data of the specified length from the current position in a large rawfile. | 45| int [OH_ResourceManager_SeekRawFile64](rawfile.md#oh_resourcemanager_seekrawfile64) (const [RawFile64](rawfile.md#rawfile64) \*rawFile, int64_t offset, int whence) | Searches for the data read/write position in a large rawfile based on the specified offset. | 46| int64_t [OH_ResourceManager_GetRawFileSize64](rawfile.md#oh_resourcemanager_getrawfilesize64) ([RawFile64](rawfile.md#rawfile64) \*rawFile) | Obtains the length of a large rawfile, in int64_t. | 47| int64_t [OH_ResourceManager_GetRawFileRemainingLength64](rawfile.md#oh_resourcemanager_getrawfileremaininglength64) (const [RawFile64](rawfile.md#rawfile64) \*rawFile) | Obtains the remaining length of a large rawfile, in int64_t. | 48| void [OH_ResourceManager_CloseRawFile64](rawfile.md#oh_resourcemanager_closerawfile64) ([RawFile64](rawfile.md#rawfile64) \*rawFile) | Closes a [RawFile64](rawfile.md#rawfile) and releases all associated resources. | 49| int64_t [OH_ResourceManager_GetRawFileOffset64](rawfile.md#oh_resourcemanager_getrawfileoffset64) (const [RawFile64](rawfile.md#rawfile64) \*rawFile) | Obtains the offset of a large rawfile, in int64_t. | 50| bool [OH_ResourceManager_GetRawFileDescriptor64](rawfile.md#oh_resourcemanager_getrawfiledescriptor64) (const [RawFile64](rawfile.md#rawfile64) \*rawFile, [RawFileDescriptor64](_raw_file_descriptor64.md) \*descriptor) | Opens a large rawfile based on the specified offset (in int64_t) and file length (in int64_t) and obtains the file descriptor. | 51| bool [OH_ResourceManager_ReleaseRawFileDescriptor64](rawfile.md#oh_resourcemanager_releaserawfiledescriptor64) (const [RawFileDescriptor64](_raw_file_descriptor64.md) \*descriptor) | Releases a file descriptor. | 52