Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Deleting a Folder in use

0 replies · 869 views · Started 22 June 2006

Hi

look at this code:


TBuf<256> kDirToDelete;
_LIT(kDirName, "C:\\try"😉;
kDirToDelete.Copy(kDirName);
folderExplorer->deleteDirL(kDirToDelete);


void CSymbianClientFolderExplorer::deleteDirL(const TDes& kDirToDelete)
{
RFs fsSession;

// Connect to the file server
fsSession.Connect();
CleanupClosePushL(fsSession);

// Delete a folder
User::LeaveIfError(fsSession.RmDir(kDirToDelete));

// Close the connection with the file server
CleanupStack::PopAndDestroy(1);
}

When i use it to delete a folder i even get the message "In use by another application (-14)". That appens in any case, both on the Epoc32 Emulator that on my Phone Nokia 6680.
State that the directory is closed and empty. I also tryed unmount the file system but the directory couldn't be removed because in use! All application all obviusly closed.

Note that the directory i want to delete is a simple folder created by me with only for try that is: C:\\try
Note also that i manage to remove any files without any problem with a similar code.

Can someone help me to understeand why? how i can delete a dir?