mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 19:08:58 +00:00
a2b8f2361e
### Purpose Avoid the issue where the folder marker is deleted by overzealous cleanup tools because it's just a useless, empty directory. We create a small file containing a an admonishment to not delete the directory, and some metadata that is just for human consumption at the moment. (But it would parse as a valid yaml file if we wanted to read this, at some point.) This will only apply when _creating_ a folder marker, that is, existing setups will not gain the file automatically. Obviously, when using a custom folder marker none of this applies. Also, slightly adjust the permission bits for the folder marker directory and file on Unixes, making sure the group & write bits are unset. ### Testing I've created and deleted a few folders and it appears to behave as I expect. ### Screenshots ``` jb@ok:~/somefolder % ls -la total 0 drwxr-xr-x 3 jb staff 96 May 1 08:52 ./ drwx------ 12 jb staff 384 May 1 08:52 ../ drwxr-xr-x 3 jb staff 96 May 1 08:52 .stfolder/ jb@ok:~/somefolder % ls -l .stfolder total 8 -rw-r--r-- 1 jb staff 122 May 1 08:52 syncthing-folder-39a4b0.txt jb@ok:~/somefolder % cat .stfolder/syncthing-folder-39a4b0.txt # This directory is a Syncthing folder marker. # Do not delete. folderID: xtdca-cudyf created: 2024-05-01T08:52:49+02:00 ``` |
||
---|---|---|
.. | ||
mocks | ||
testdata | ||
blockpullreorderer_test.go | ||
blockpullreorderer.go | ||
debug.go | ||
deviceactivity_test.go | ||
deviceactivity.go | ||
devicedownloadstate_test.go | ||
devicedownloadstate.go | ||
doc.go | ||
fakeconns_test.go | ||
folder_recvenc.go | ||
folder_recvonly_test.go | ||
folder_recvonly.go | ||
folder_sendonly.go | ||
folder_sendrecv_test.go | ||
folder_sendrecv_unix.go | ||
folder_sendrecv_windows.go | ||
folder_sendrecv.go | ||
folder_summary.go | ||
folder_test.go | ||
folder.go | ||
folderstate.go | ||
indexhandler_test.go | ||
indexhandler.go | ||
metrics.go | ||
model_test.go | ||
model.go | ||
progressemitter_test.go | ||
progressemitter.go | ||
queue_test.go | ||
queue.go | ||
requests_test.go | ||
sentdownloadstate.go | ||
service_map_test.go | ||
service_map.go | ||
sharedpullerstate_test.go | ||
sharedpullerstate.go | ||
testos_test.go | ||
testutils_test.go | ||
util.go | ||
utils_test.go |