FSResult FS_ARCHIVE_PROC_FUNC(FSFile *p_file, FSCommandType command /*
= FS_COMMAND_READFILE */);
Operating specifications for the archive command FS_COMMAND_READFILE
are shown below:
This command takes as a command argument the variablearg.readfile
that is stored inp_file
.
This variable is defined innitro/fs/file.h
as shown below: typedef struct { void *dst; u32 len_org; u32 len; } FSReadFileInfo;
Argument content is listed below:
Arguments | Content |
dst | Points to the transfer destination memory address where read data is stored. |
len_org | Indicates the size of data to read (bytes), using the specified value as is. |
len | Specifies the size of data to read (bytes), using the value that is adjusted by the file size at the time that the command is called. |
p_file
is a handle that always holds file information inprop.file
.
Based onp_file
'sprog.file
variable, the command makes the following settings: Transferslen
bytes of data from the archive offset position indicated byprop.file.pos
, to memory atdst
. Adds value oflen
toprop.file.pos
.
The value len is adjusted from the specified value, takingprop.file.bottom
into consideration. If you want to run a special process when a write exceeds the file size, you can use the original value that is stored inlen_org
.
Uses the archive read callback function to transferlen
bytes from the base offset position indicated byprop.file.pos
todst
. Adds value oflen
toprop.file.pos
.
IfFS_RESULT_SUCCESS
is returned by the command, it will be determined that the transfer process forlen
bytes completed properly. When anything else is returned by the command, it will be determined that transfer failed due to some error.
FS_ReadFile FS_ReadFileAsync
FSArchive
, FS_ARCHIVE_PROC_FUNC
, FS_COMMAND_*
, FS_SetArchiveProc
2004/07/12 Initial version.
CONFIDENTIAL