Cryotomator not doing housekeeping for the "d" folder?

Hi everyone,

As you know, Cryptomator creates a folder “d”. In this folder, it creates a subfolder for each folder you create in the mounted drive. However, it does not delete the subfolder when you delete the folder in the mounted drive leaving behind many empty subfolders.

Is this normal behaviour? It feels like it is not cleaning up?

regards,
Jeroen

Hi Jeroen.
Please see here: Cleaning up folder structure

Thank you Michael. Sorry I missed that thread somehow. Is there a script/command that can be used to automate the cleanup?

No, at least not from our side. @tobihagemann linked a github issue in the other thread where you can read, that only the first two-letter subdirectories can be safely deleted.

But it is not difficult to create a script which, when exectuted in the d-directory, will delete all empty folders.

For Windows a possible powershell script looks the following:

Get-ChildItem -Attributes Directory | ForEach-Object { if ($(Get-ChildItem($_) | Measure-Object).Count -eq 0) {Remove-Item($_)}}

Use this at your own risk.

1 Like

A little optimized (no loop, no measure command, no if):
(Get-ChildItem -Directory).Fullname | Where-Object { (Get-ChildItem $_).Count -eq 0} | Remove-Item -Force

The Remove-Item -Force is necessary if your filesystem uses junction points (e.g. the Cryptomator-Folder is part of OneDrive or DropBox)

1 Like