Difference between revisions of "Bfile FindNext"

From WikiPrizm
Jump to navigationJump to search
(Initial page after experimenting)
 
Line 3: Line 3:
 
| index = 0x1DB9
 
| index = 0x1DB9
 
| header = fxcg/file.h
 
| header = fxcg/file.h
| signature = int Bfile_FindNext( int FindHandle, const unsigned short *foundfile, file_type_t *fileinfo );
+
| signature = int Bfile_FindNext(int FindHandle, const unsigned short* foundfile, file_type_t* fileinfo);
 
| parameters = * ''int'' '''FindHandle''' - The find handle created by [[Bfile_FindFirst]].
 
| parameters = * ''int'' '''FindHandle''' - The find handle created by [[Bfile_FindFirst]].
 
* ''const unsigned short*'' '''foundfile''' - The string used to store the found file or folder name.
 
* ''const unsigned short*'' '''foundfile''' - The string used to store the found file or folder name.
Line 11: Line 11:
 
| synopsis = This function is used to list files and folders based on a find handle created by [[Bfile_FindFirst]]
 
| synopsis = This function is used to list files and folders based on a find handle created by [[Bfile_FindFirst]]
 
| example = To read files, create a handle with [[Bfile_FindFirst]]. If the return value is 0, then the foundfile and fileinfo values are set.  Keep calling this function, checking the return, then printing if 0 to read all files in the find handle.  See [[Using_the_File_System#Finding_and_Listing_Files_and_Folders|the Using the File System tutorial]] for a full example
 
| example = To read files, create a handle with [[Bfile_FindFirst]]. If the return value is 0, then the foundfile and fileinfo values are set.  Keep calling this function, checking the return, then printing if 0 to read all files in the find handle.  See [[Using_the_File_System#Finding_and_Listing_Files_and_Folders|the Using the File System tutorial]] for a full example
 +
| comments = {{BfileTimersWarning}}
 
}}
 
}}
 
 
[[Category:Syscalls:Bfile]]
 
[[Category:Syscalls:Bfile]]

Revision as of 19:44, 29 July 2014


Synopsis

Header: fxcg/file.h
Syscall index: 0x1DB9
Function signature: int Bfile_FindNext(int FindHandle, const unsigned short* foundfile, file_type_t* fileinfo);

This function is used to list files and folders based on a find handle created by Bfile_FindFirst

Parameters

  • int FindHandle - The find handle created by Bfile_FindFirst.
  • const unsigned short* foundfile - The string used to store the found file or folder name.
  • file_type_t fileinfo - Pointer to a file_type_t struct. See Bfile_FindFirst for the struct definition.

Returns

  • 0 - Successful read. Data is stored to foundfile and fileinfo
  • -16 - There are no more files or folders to be read. When this happens, call Bfile_FindClose on the FindHandle.

Comments

Using Bfile functions while user timers are installed can cause SYSTEM ERRORs and other undefined behavior, especially with functions that change data on the file system. Make sure to stop and uninstall all timers before using Bfile functions (and optionally restore them later). See Incompatibility between Bfile Syscalls and Timers for more information.

Example

To read files, create a handle with Bfile_FindFirst. If the return value is 0, then the foundfile and fileinfo values are set. Keep calling this function, checking the return, then printing if 0 to read all files in the find handle. See the Using the File System tutorial for a full example