-
Notifications
You must be signed in to change notification settings - Fork 1
/
notes.html
45 lines (44 loc) · 2.01 KB
/
notes.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html>
<head>
<title>Cornus - a few notes</title>
</head>
<body>
<hr/>
<b>Trash Can Support</b>
<p/>
Since the official XDG trash specification is over engineered, slow and doesn't prevent dangling files, Cornus follows a different approach which allows for a very fast, efficient and very simple trash can implementation.
<p/>
The official XDG trash can spec:
<ul>
<li/>Mandates creating 2 files per file deleted
<li/>Files can be placed into random partitions which doesn't prevent copying of files.
<li/>Undeleting files is thus rather I/O expensive since one needs to read *all* files from *all* trash folders, processing them and only then proceeding undeleting files, potentially involving copying (instead of atomic moving).
</ul>
The Cornus file browser places deleted files in a hidden folder at
same location and puts the meta in its title, thus the pros:
<ul>
<li/>Avoids ever copying files
<li/>No opening/reading/closing of files
<li/>No 2 files (info file + the file itself) per deleted file.
<li/>No dangling files (when the user deletes a folder he automatically also deletes its trash if any)
<li/>Listing files to undelete is instant
<li/>Is very easy to group deleted files into batches sorted by deletion time and give the user the option to choose which batch to undelete, a feature implemented (only) by Cornus.
<li/>No need to sort out which files belong to a folder and which ones don't
<li/>No filename clashes thus no need to implemenent name clash prevention
<li/>Extremely simple implementation
</ul>
<p/>
And one big con:<ul>
<li/>Some users might not want to have a trash folder in the same folder
where the files were deleted even if the trash is hidden.
</ul>
However the latter is somewhat leveraged in cases of git projects
because Cornus automatically adds an entry to the <b>global</b>
gitignore file thus:
<ul>
<li/>All git projects will be unaffected by a potentially unwanted hidden folder.
<li/>No need to touch the .gitignore file of any projects
<li/>The user doesn't have to do anything at all.
</ul>
</body>
</html>