Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/config: Add file inside folder marker directory #9525

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

calmh
Copy link
Member

@calmh calmh commented May 1, 2024

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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant