cppcryptfs icon indicating copy to clipboard operation
cppcryptfs copied to clipboard

Empty directories that can't be deleted

Open ScottRFrost opened this issue 2 years ago • 6 comments

I've been using cppcryptfs for about a year now, and I've run into a problem where I get directories that can't be deleted, even though they're empty.

For example: Screenshot

These directories still can't be deleted after reboot and across multiple machines (it's a subfolder inside of OneDrive, using the windows built-in OneDrive syncing).

The only way I've been able to recover from this in the past is to create a whole encrypted container, move the files I want to keep, then delete the container.

Does anyone else have a similar problem? If so, how did you solve it?

ScottRFrost avatar Feb 03 '22 22:02 ScottRFrost

I encountered a similar problem in the new version. When I use Ctrl + CV to copy in the unlocked directory Such a mistake will happen My solution is to find a file with the same name and copy it from the outside. The system will prompt that the file already exists and overwrite it Then reload the directory The probability will recover My personal guess is The encrypted file has not actually been deleted, but it will not be displayed correctly So the folder is not actually empty In my system environment, the deletion and copy operations of the new version become almost unavailable. Deleting any file takes about 20 seconds, and two takes 40 seconds. You can find the problem I mentioned earlier. There are temporary solutions As for the copy operation in the encrypted file directory, I copy it to other disks and then copy it back to the encrypted directory. Cutting files in the same directory will cause 100% errors for me, resulting in the same situation as you. The files will not be displayed and cannot be deleted

BrsyRockSs avatar Feb 04 '22 13:02 BrsyRockSs

I've also faced this issue today with the latest version.

To overcome this, I added a new folder into the mounted directory folder that I wasn't able to delete normally, in order to identify (by date/time) the problem outer encrypted folder. I then unmounted the drive, deleted this encrypted folder and then remounted.

wards999 avatar Feb 20 '22 15:02 wards999

I updated dokan and winfsp to the latest version, and the problem was solved

BrsyRockSs avatar Mar 04 '22 05:03 BrsyRockSs

I thought cppcryptfs only uses dokany?

wards999 avatar Mar 04 '22 12:03 wards999

I thought cppcryptfs only uses dokany?

I use rclone to mount WebDAV locally on win10, and then use CPP on the mount volume, Rclone uses winfsp

BrsyRockSs avatar Mar 04 '22 14:03 BrsyRockSs

I'm getting similar with a drive I have mounted on top of Google Drive for desktop. Trying to delete through File Explorer fails silently, if I delete through Powershell like in the OP I get this claiming the directory isn't empty when it is:

rd : Cannot remove item K:\Documents\CHX\: The directory is not empty.
At line:1 char:1
+ rd .\CHX\
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (K:\Documents\CHX\:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand

When I have Enable Mount Manager turned on, the error in Powershell is the same but I get an 0x80070091 error dialog deleting through File Explorer as per #19.

Ironically, directories that really aren't empty can still be deleted so I can work around it by dropping an empty text file in the folder before deleting.

EDIT: This might be a regression in the Google Drive client, as deleting directories still works when mounting via rclone instead.

ablakers avatar Mar 06 '22 13:03 ablakers