Fix sshfs: file systems that do not support hard links but make a copy instead.
Three cases need to be considered:
- The file system supports hard links created by
link()
. - The file system does not support
link()
. This is covered by callingcopy_to_temp_file()
instead. - The file system does not support hard links, however it makes
a copy instead when
link()
is called.
The third case is not covered yet: link()
generates the file, but
this is not noticed and in turn making a copy in copy_to_temp_file()
fails, as the file already exists. The loop generates files until
MAX_TRIES
is reached.
The commit checks if 'result' exists after calling link()
and covers
the last case which is needed to support home directories on sshfs.
Corresponding issue: #84
Edited by Andreas