# FS_COMMAND_OPENFILEFAST

## Definition

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

## Description

Operating specifications for the archive command `FS_COMMAND_OPENFILEFAST` are shown below:

Arguments passed to this command

>     This command takes (as a command argument) the variable arg.openfilefast that is stored at p_file.

>     This variable is defined in nitro/fs/file.h as shown below:

>     typedef struct
>     {
>         FSFileID id;
>     } FSOpenFileFastInfo;

> Argument content is listed below:

Arguments | Content
id | The ID of the file to be opened. The `FS_COMMAND_READDIR` command generates this value.

Actions required of this command

>     It sets the p_file variable prop.file as shown below:

>     Appropriately sets each of the prop.file variables, based on the file ID that is defined in the id argument.
>       The set values are used by subsequent FS_COMMAND_READFILE and FS_COMMAND_WRITEFILE commands.
>       You may determine your own meanings for the prop.file variables as long as they are appropriate arguments for these commands.
>       However, prop.file.pos must be within the range prop.file.top - prop.file.bottom.

Default Implementation

> The command sets values based on the following determinants:

prop.file.top | The area top position that is acquired from the FAT information that the specified file index indicates. (Conforms to NitroROM format.)
prop.file.bottom | The area bottom position that is acquired from the FAT information that the specified file index indicates. (Conforms to NitroROM format.)
prop.file.pos | Sets the same value as `prop.file.top`
prop.file.own_id | Sets the argument `id` as is.

> As long as the archive's FAT conforms to the NitroROM format (determined by using the archive read callback function), this information is acquired from the FAT index that is indicated by `id.file_id`. The `FS_COMMAND_OPENFILEDIRECT` command is used to make the setting.

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 in arguments in functions that operate on files.

Functions that use this command

> FS_OpenFile
> FS_OpenFileFast

## See Also

`FSArchive`, `FS_ARCHIVE_PROC_FUNC`, `FS_COMMAND_*`, `FS_SetArchiveProc`

## Revision History

2004/07/12 Initial version.

CONFIDENTIAL