MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _copyxattr

Function _copyxattr

tools/python-3.11.9-amd64/Lib/shutil.py:316–338  ·  view source on GitHub ↗

Copy extended filesystem attributes from `src` to `dst`. Overwrite existing attributes. If `follow_symlinks` is false, symlinks won't be followed.

(src, dst, *, follow_symlinks=True)

Source from the content-addressed store, hash-verified

314
315if hasattr(os, 'listxattr'):
316 def _copyxattr(src, dst, *, follow_symlinks=True):
317 """Copy extended filesystem attributes from `src` to `dst`.
318
319 Overwrite existing attributes.
320
321 If `follow_symlinks` is false, symlinks won't be followed.
322
323 """
324
325 try:
326 names = os.listxattr(src, follow_symlinks=follow_symlinks)
327 except OSError as e:
328 if e.errno not in (errno.ENOTSUP, errno.ENODATA, errno.EINVAL):
329 raise
330 return
331 for name in names:
332 try:
333 value = os.getxattr(src, name, follow_symlinks=follow_symlinks)
334 os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)
335 except OSError as e:
336 if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA,
337 errno.EINVAL):
338 raise
339else:
340 def _copyxattr(*args, **kwargs):
341 pass

Callers 1

copystatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected