FSResult FS_ARCHIVE_PROC_FUNC(FSFile *p_file, FSCommandType command /* = FS_COMMAND_SEEKDIR */);
Operating specifications for the archive command FS_COMMAND_SEEKDIR
are shown below:
This command takes as a command argument the variablearg.seekdir
that is stored inp_file
.
This variable is defined innitro/fs/file.h
as shown below: typedef struct { FSDirPos pos; } FSSeekDirInfo;
Argument content is listed below:
Arguments | Content |
pos |
The directory position to be moved is stored in a FSDirPos type.The FS_COMMAND_READDIR command generates this value. |
It sets thep_file
variableprop.dir
as shown below:
Sets the directory position that is held by the argumentpos
inprop.dir.pos
. If bothpos.index
andpos.pos
are0
, it signifies the top of the directory array position.
The set values are used by subsequentFS_COMMAND_SEEKDIR
andFS_COMMAND_READDIR
commands. You may determine your own meanings for thepos
name variables as long as they are appropriate arguments for these commands. Sets the index for the parent directory at the directory position indicated by the argumentpos
inprop.dir.parent
.pos.own_id = 0
" signifies the root directory. In the case of the root directory, this sets the total number of directories intoprop.dir.parent
.
The set values are used by subsequentFS_COMMAND_GETPATH
commands.
The command sets values based on the following determinants:
prop.dir.pos.arc | Uses the arguments as-is |
prop.dir.pos.own_id | Uses the arguments as-is |
prop.dir.pos.index | The position at which the next FNT directory entry resides. (Conforms to NitroROM format) |
prop.dir.pos.pos | If the next directory entry is a file, that file's index This value increments by one each time FS_COMMAND_READDIR completes successfully.(Conforms to NitroROM format) |
prop.dir.parent | Parent directory's index, or total number of directories. (Conforms to NitroROM format) |
As long as the archive's FNT conforms to the NitroROM format (determined by using the archive read callback function), this information is acquired from the FNT entry block that is indicated by pos.own_id
.
If this command returnsFS_RESULT_SUCCESS
,p_file
becomes a handle that contains directory position information. Subsequently theFS_IsDir
function returnsTRUE
. It can also be used as an argument in functions that operate on directories.
FS_SeekDirFS_RewindDir
(indirectly from the defaultFS_FINDPATH
command) FS_ChangeDir FS_OpenFileFS_ConvertPathToFileID
(indirectly from the default FS_GETPATH command) FS_GetPathName FS_GetPathLength
FSArchive
, FS_ARCHIVE_PROC_FUNC
, FS_COMMAND_*
, FS_SetArchiveProc
07/12/2004 Initial version.