--read-special: .part files also should be regular files, fixes #5217

This commit is contained in:
Thomas Waldmann 2020-06-14 15:36:22 +02:00
parent 91cf1a35b0
commit dee402652f
1 changed files with 5 additions and 4 deletions

View File

@ -1249,6 +1249,11 @@ class FilesystemObjectProcessors:
st = stat_update_check(st, os.fstat(fd))
item.update(self.metadata_collector.stat_simple_attrs(st))
is_special_file = is_special(st.st_mode)
if is_special_file:
# we process a special file like a regular file. reflect that in mode,
# so it can be extracted / accessed in FUSE mount like a regular file.
# this needs to be done early, so that part files also get the patched mode.
item.mode = stat.S_IFREG | stat.S_IMODE(item.mode)
if not hardlinked or hardlink_master:
if not is_special_file:
path_hash = self.key.id_hash(safe_encode(os.path.join(self.cwd, path)))
@ -1298,10 +1303,6 @@ class FilesystemObjectProcessors:
self.stats.nfiles += 1
item.update(self.metadata_collector.stat_ext_attrs(st, path, fd=fd))
item.get_size(memorize=True)
if is_special_file:
# we processed a special file like a regular file. reflect that in mode,
# so it can be extracted / accessed in FUSE mount like a regular file:
item.mode = stat.S_IFREG | stat.S_IMODE(item.mode)
return status