Currently, if an AtomicFile is opened on a symlink, the AtomicFile would
end up overwriting the link. This change makes AtomicFiles operate on
the targets of the links and not the links themselves.
NOTE: Due to the way Path is implemented in libshared, this change
will not preserve links if the link does not have a valid target.
Currently, if an AtomicFile is opened on a symlink, the AtomicFile would end up overwriting the link. This change makes AtomicFiles operate on the targets of the links and not the links themselves.
NOTE: Due to the way Path is implemented in libshared, this change will not preserve links if the link does not have a valid target.
The
Path::exists()
will always follow links, and therefore is_link() will erroneously return false: https://github.com/GothenburgBitFactory/libshared/blob/master/src/FS.cpp#L204