MCPcopy Index your code
hub / github.com/borgbackup/borg / process_symlink

Method process_symlink

src/borg/archive.py:1367–1381  ·  view source on GitHub ↗
(self, *, path, parent_fd, name, st, strip_prefix)

Source from the content-addressed store, hash-verified

1365 return status
1366
1367 def process_symlink(self, *, path, parent_fd, name, st, strip_prefix):
1368 with self.create_helper(path, st, "s", hardlinkable=True, strip_prefix=strip_prefix) as (
1369 item,
1370 status,
1371 hardlinked,
1372 hl_chunks,
1373 ):
1374 if item is None:
1375 return status
1376 fname = name if name is not None and parent_fd is not None else path
1377 with backup_io("readlink"):
1378 target = os.readlink(fname, dir_fd=parent_fd)
1379 item.target = target
1380 item.update(self.metadata_collector.stat_attrs(st, path)) # can't use FD here?
1381 return status
1382
1383 def process_pipe(self, *, path, cache, fd, mode, user=None, group=None):
1384 status = "i" # stdin (or other pipe)

Callers

nothing calls this directly

Calls 4

create_helperMethod · 0.95
stat_attrsMethod · 0.80
readlinkMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected