This topic describes how to delete an empty directory and a file.
Use RmDir() to delete an empty directory. Use Delete() to delete a file.
// Deletes KTopDir, deleting all files and sub-directories first User::LeaveIfError(fsSession.Delete(KFile2)); User::LeaveIfError(fsSession.RmDir(KDir1)); User::LeaveIfError(fsSession.RmDir(KDir2)); User::LeaveIfError(fsSession.Delete(KFile1)); User::LeaveIfError(fsSession.RmDir(KTopDir)); ...
Files must be closed and must not be read-only in order to be deleted.
RFs::Delete() does not accept the use of wildcards . To delete multiple files, use CFileMan::Delete() instead.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.