#include <nitro/fs.h>
BOOL FS_SetSeekCache(FSFile *file, void* buf, u32 bufsize);
file |
An already open file. For more details, see the Notes section. |
buf |
Buffer to be used as the seek cache. Use of the cache buffer already configured is cancelled if NULL is specified. For details on the conditions that apply to the argument, see the Notes section. |
bufsize | Buffer size. Use the FS_GetSeekCacheSize function to get the required size for the seek cache. If the size is small, the library will build the largest cache it can within the size provided. |
Returns TRUE if the process succeeds.
Returns FALSE in the following situations.
Sets the seek cache buffer.
With archives like NAND archives or SD Card archives that use FAT as the internal format, operations that seek to the end of the file and operations that seek in the reverse direction may require a significant execution cost. If you know that you will be making frequent use of seek operations on read-only files, you can improve the seek speed by using this function.
The buffer set with this function will be managed by the library until either the file is closed or NULL is specified to explicitly cancel use of the file.
This function uses only the cropped region of the specified buffer that remains after the start and end have been aligned with the cache line boundary. The buffer size retrieved by the FS_GetSeekCacheSize
function contains enough space for addresses of any length.
FS_SeekFile
FS_GetSeekCacheSize
2009/02/05 Explained the buffer's alignment to cache line boundary.
2008/07/01 Noted that the file must be opened in read-only mode.
2008/06/26 Initial version.
CONFIDENTIAL