FSResult FS_ARCHIVE_PROC_FUNC(FSFile *p_file, FSCommandType command /*
= FS_COMMAND_GETPATH */);
Operating specifications for the archive command FS_COMMAND_GETPATH
are shown below:
This command takes as a command argument the variablearg.getpath
that is stored inp_file
. This variable is defined innitro/fs/file.h
as shown below: typedef struct { u8 *buf; u32 buf_len; u16 total_len; u16 dir_id; } FSGetPathInfo;
Argument content is listed below:
Arguments | Content |
buf | This indicates a pointer to the memory that stores the acquired absolute path name string.
If this value is NULL , there is no need to acquire an absolute path name string. |
buf_len |
This indicates the memory size of buf (bytes). |
total_len |
This indicates the length of a valid absolute path name string that has already been calculated.
If this value is 0 , you must configure properly. |
dir_id |
If the target is a directory, this indicates a position; if the target is a file, this indicates the position of the directory to which it belongs. If total_length is 0 , you must correctly set the value. |
p_file
holds either file information or directory position information. You can determine which it holds with theFS_IsFile
function or theFS_IsDir
function. The argument variables are set as shown below: If the argumenttotal_len
is0
, the length of the absolute path name string indicated byp_file
, including the terminating '\0
', will be set intotal_len
. Ifp_file
is a directory its value will be set indir_id
; ifp_file
is a file, the position of the directory that it belongs to will be set indir_id
. Iftotal_len
is not0
, it is assured that this command has already made this setting. If the argumentbuf
is notNULL
, the absolute path name string indicated byp_file
, including the terminating '\0
' will be stored in memory. However, ifbuf_len
is less thantotal_len
,FS_RESULT_FAILURE
must be returned. At this time, it is possible to either store as much of the string as possible, or store nothing.
Seek results from the provided arguments, using only theFS_COMMAND_SEEKDIR
andFS_COMMAND_READDIR
commands.
IfFS_RESULT_SUCCESS
is returned by the command, it is determined that a valid absolute path name string length has been set intotal_len
. If buf is not NULL, the absolute path name string, including the terminating '\0
' has been stored. Otherwise it will be determined thatbuf
is notNULL
, and thatbuf_len
is less thantotal_len
.
FS_GetPathLength
FS_GetPathName
FSArchive
, FS_ARCHIVE_PROC_FUNC
, FS_COMMAND_*
, FS_SetArchiveProc
2004/08/25 Corrected error: FSIdFile
is changed to FS_IsFile
.
2004/07/12 Initial version.
CONFIDENTIAL