FS_COMMAND_SEEKDIR


C Specification

FSResult FS_ARCHIVE_PROC_FUNC(
    FSFile          *p_file,
    FSCommandType   command /* = FS_COMMAND_SEEKDIR */);

Description

Operating specifications for the archive command FS_COMMAND_SEEKDIR are shown below:


Arguments passed to this command
This command takes as a command argument the variable arg.seekdir that is stored in p_file.
This variable is defined in nitro/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.

Actions required of this command
It sets the p_file variable prop.dir as shown below:

Default Implementation
The command sets values based on the following:
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.

Command Results
If this command returns FS_RESULT_SUCCESS, p_file becomes a handle that contains directory position information. Subsequently the FS_IsDir function returns TRUE. It can also be used as an argument in functions that operate on directories.

Functions that use this command

See Also

FSArchive, FS_ARCHIVE_PROC_FUNC, FS_COMMAND_*, FS_SetArchiveProc

Revision History

07/12/2004 Initial Version