Trashbin should restore file including path

The Seafile trashbin requires files to be restored in reverse temporal order they were deleted. Otherwise path information is lost upon restoration.

This is critical for files that have generic names, like “” or “license.txt” etc.

This is the problematic behavior:

1. Starting out with a simple directory structure

2. Delete files and folders

  1. Delete file
  2. Delete file
  3. Delete folder `Level 1’

The trash bin now looks like this:

3. Restore files and folders

3.1 Restore file

The restored file appears at the root path of the library instead of its original path Level 1/Level 2/file Confusingly, the file also remains visible in the trash bin!

3.2 Restore folder Level 1

The folder, including its subfolder Level 2 and file present at time of putting into trash are correctly restored. The folder disappears from Trash.

3.3 Restore file

The file appears at its original path Level 1/Level 2/file and disappears from the Trash.

Restoring paths is important

If a file is restored but its original path is not existing at time of restoration, the restored file will re-appear in a different location and remain in the Trash.

This behavior is highly confusing and can easily lead to data loss because it will not be possible to know where the file was originally located. You want to have a license.txt file re-appear in the correct open source project folder, and a printing instructions.docx in the folder with the correct images you send to an offset printer.

Users expectations

Every reasonable graphical user interface desktop since Windows 95 restores files from the trash bin including their path. Since I don’t have Windows 95 available right now, here is how it works in Windows XP and has ever since:

Starting out with a similar directory structure as in Seafile:

Delete file_1. It appears in the recyble bin:

Delete folder_1. It appears in the recycle bin:

Restore file_1 from the recycle bin. It is restored with its full original path folder_1\folder_2\file_1. folder_1 is still in the recycle bin.

Restore folder_1. file_2 re-appears at its previous path folder_1\folder_2\file_2. The recycle bin is now empty.

Perfect! The same mechanism is used on Windows 7, Windows 10, Windows 11, Mac OS and most Linux desktops. It makes sense and helps to prevent data loss.

It would be great if Seafile would handle it in the same way.


We’ll look into this request. Thanks!

1 Like