83Plus:Software:usb8x/Asm Interface/MSD/DOS renameFileEntry
Minimum usb8x version: 0.10
Renames a file or folder.
- HL points to an ASCIIZ string of the old file/directory name, including path (ex. "/test1/test2/RenameMe.txt")
- DE points to an ASCIIZ string of the new name (ex. "NewName.txt")
- Entry is renamed
- C set if problems
- AF, BC, DE, HL
This works with both file and folder names.
Example code to rename "old.txt" to "new.txt" in the root directory:
ld hl,sOldName ld de,sNewName U_CALL DOS_renameFileEntry ... sOldName: DB "/old.txt",0 sNewName: DB "new.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.
- [[../FAT_lookupPath|FAT_lookupPath]] - Find whether specified file/directory exists