File_RenameDir()

Parent Previous Next

File_RenameDir(pOldName, pNewName), Byte


pOldName: The current name of the directory to rename (maximum length 8 characters).

pNewName: The new name for the directory (maximum length 8 characters).


Return Status:

• cErrOK: Success.

• cErrExists: The new directory name already exists.

• cErrNotFound: The old directory name was not found.

• cErrRWError: Read/write error.


Rename Directory


This procedure renames a directory from the old name (pOldName) to the new name (pNewName). Both names are limited to a maximum length of 8 characters, including the dot and file extension.


Example:

File_RenameDir("OldFolder", "NewFolder")


TftSetUp(0)                                                                                 'Set screen

TftResetScreen(BLACK)                                                                       'Reset screen

TftSetSndFont(0,0)                                                                          'Set Font0

While File_Init() <> cErrOK : Wend                                                          'Initialize SD Card

TftPrintSndString("Sd Initialization OK",1,0,0,1,GREEN,BLACK,0)                             'Confirm Initialize SD Card

While File_Rename("pic.log","gif.txt") <> cErrOK : Wend                                     'Rename file pic.log to gif.txt

TftPrintSndString("Rename pic.Log OK",1,0,2,1,GREEN,BLACK,0)                                'Confirm rename file pic.Log To gif.txt

While File_RenameDir("test","stop") <> cErrOK : Wend                                        'Rename folder test to stop

TftPrintSndString("Rename test OK",1,0,3,1,GREEN,BLACK,0)                                   'Confirm rename folder test To Stop 

 

 





Created with the Personal Edition of HelpNDoc: Qt Help documentation made easy