# FS_CreateFileFromMemory

## C Specification

  `#include <nitro/fs.h>`
  `BOOL FS_CreateFileFromMemory(FSFile *p_file, void *buf, u32 size);`

## Arguments

p_file | Address of the `FSFile` structure.
buf | Start of the memory region for the read or write.
size | Byte size of buf.

## Return Values

TRUE if the file opens properly. FALSE otherwise.

## Description

Treats the address region in the specified memory map as a temporary file and opens the file. The file opened by this function supports only these following functions:

- `FS_SeekFile`, `FS_SeekFileToBegin`, `FS_SeekFileToEnd`
- `FS_ReadFile`, `FS_WriteFile`
- `FS_ReadFileAsync`, `FS_WriteFileAsync` (Behaves the same way as the synchronous version)
- `FS_CloseFile`

For further information, see the explanation for the Memory File Archive.

## Caution

This function cannot be called from the interrupt handler (IRQ mode).
Also note that in some cases processing may not end if interrupts are left prohibited.

## See Also

`FSFile FSArchive Memory File Archive`

## Revision History

06/28/2005 Initial version.

CONFIDENTIAL