Handling of symbolic and/or hard links on Linux

I’m a little confused by the FAQ entries on how syncthing handles both symbolic links and hard links.

So, if there is a file in a directory synchronised by syncthing which has other hard links to it will these hard links be lost? I suspect they will because when syncthing updates a file it presumably changes its inode (i.e. it doesn’t update ‘in place’).

… and secondly I think syncthing will synchronise a symbolic link but not the file it points at. I.e. the pointer is preserved/changed but not what it points at.

Do I have these correct?

Yes. Syncthing copies files on all changes, therefore doesn’t preserve hardlinks, and syncs symbolic links themselves, never their targets.

2 Likes

If this clarifies things for you, let us know how to improve the FAQ entry. In my mind, imsodin said almost exactly what the FAQ entry says. :slight_smile:

2 Likes

Well I think it could do with a little bit of expansion. What the FAQ says is:-

Symbolic Links (synced, except on Windows, but never followed.)

This doesn’t quite say “syncthing will synchronise a symbolic link but not the file it points at”

… and:-

Hard Links (followed, not preserved)

You really, really don’t “follow” a hard link. I think one should say syncthing always creates a new copy of the file and that the hard link is destroyed. If there happens to be another hard link to the same (original) file then the original file will still exist.

1 Like

We should just say not preserved.

To help me understand:

How are symbolic links handled on windows?

They aren’t. They are skipped when scanning the local disk and they are also skipped when pulling changes from other devices.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.