83Plus:Software:usb8x/Asm Interface/MSD/FAT lookupPath
From WikiTI
Synopsis
Name: FAT_lookupPath
Minimum usb8x version: 0.10
Determines whether a file/directory exists.
Inputs
- HL points to an ASCIIZ string containing a path to a file/directory
Outputs
- HL points to the 32-byte directory entry for the file/directory
- C set if not found
Destroys
- AF, BC, DE, HL
Notes
This routine will also point to the directory entry if found (useful for [[../DOS_getFileSize|DOS_getFileSize]], for example).
Example code to find whether "readme.txt" exists in the "test" directory:
ld hl,sFilename U_CALL FAT_lookupPath ;HL points to directory entry jr c,notFound ... notFound: ... sFilename: DB "/test/readme.txt",0
If you are writing an application, you must copy the strings you use to RAM first, or else usb8x will not be able to see them.
See Also
- [[../DOS_getFileSize|DOS_getFileSize]] - Get file size for specified directory entry