@CHIP-RTOS C Library V2.00 - BIOS API
BIOS_Fast_Findfirst
Provide a faster access to the file
systems directories. int BIOS_Fast_Findfirst ( char far *filename,
FILE_FIND far *find,
unsigned int attributes ); Parameters
filename
- Pointer to null terminated ASCII file name pattern
for search.
find
- Pointer to a FILE_FIND structure.
attributes
- File attributes
Return Value
- -1: Findfirst is already active
0: No file found
1: Success
Comments
- This function and the
BIOS_Fast_Findnext
provide a faster
findfirst/next access than do the DOS compatible functions available on
software interrupt
0x21.
These functions work in a similiar way to the DOS SWI 0x21 findfirst/next
functions. BIOS_Fast_Findfirst must be called first. Then the
BIOS_Fast_Findnext is used repeatedly as required to iterate through
all the files in a directory matching the specified filename
pattern and attributes
.
The directory being searched will be locked for exclusive access
for the calling task. The
BIOS_Fast_Find_Done function
must
be called to release this directory lock.
.
These functions are not reentrant. The user must provide semaphore
protection if these functions are to be called from different tasks.
Note:
This function will convert the filename
string to
all upper case.
The FILE_FIND data structure format is:
typedef struct filefind
{
char filename[12]; // Null terminated filename
char fileext[4]; // and extension
unsigned short fileattr; // MS-DOS file attributes
short int reserved; // Reserved
struct tag_filetimestamp
{
// Date = ((year - 80) shl 9) or (month shl 5)) or day
unsigned short int filedate;
// Time = (hour shl 11) or (min shl 5)) or (sec / 2)
unsigned short int filetime;
} filetimestamp; // Time & date last modified
unsigned long filesize ; // File size
char private_field[180]; // Reserved, used internal
} FILE_FIND ; See Also
RTOS API
- This library function invokes a RTOS software interrupt.
Refer to this RTOS API function's
documentation
for more details.
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document
|