Training
×

APIs that act on files by name

The function names of the API are conclusive – and there always is the documentaton…
 
- move/delete files (MoveRtFile, RemoveRtFile)
MoveRtFile moves an existing file or directory, including its children. Also used to rename a file or directory
RemoveRtFile deletes a file from its medium
- get/set fileattributes (GetRtFileAttributes, SetRtFileAttributes)
Gets common file attribs including number of links to the file, identifier of it‘s volume, file number, size, create tme etc. SetRtFileAttributes only allows to set attribs like READONLY, HIDDEN etc.
- create/delete directories (CreateRtDirectory, RemoveRtDirectory)
RemoveRtDirectory must specify an empty directory. The directory is not actually removed until the last handle to the directory is closed
- search files (FindFirstRtFile, FindNextRtFile, FindRtFileClose )
FindFirstRtFile searches for the first occurance of a file or subdirectory matching a name pattern that can include wildcards such as asterisk (‘*’) or question mark (‘?’). FindNextRtFile will find the next match until no more match is found. If a call is not made to FindRtFileClose, then a memory and handle leak can result.