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

Function _samefile

tools/python-3.11.9-amd64/Lib/shutil.py:202–218  ·  view source on GitHub ↗
(src, dst)

Source from the content-addressed store, hash-verified

200 fdst_write(buf)
201
202def _samefile(src, dst):
203 # Macintosh, Unix.
204 if isinstance(src, os.DirEntry) and hasattr(os.path, 'samestat'):
205 try:
206 return os.path.samestat(src.stat(), os.stat(dst))
207 except OSError:
208 return False
209
210 if hasattr(os.path, 'samefile'):
211 try:
212 return os.path.samefile(src, dst)
213 except OSError:
214 return False
215
216 # All other platforms: check for same pathname.
217 return (os.path.normcase(os.path.abspath(src)) ==
218 os.path.normcase(os.path.abspath(dst)))
219
220def _stat(fn):
221 return fn.stat() if isinstance(fn, os.DirEntry) else os.stat(fn)

Callers 2

copyfileFunction · 0.85
moveFunction · 0.85

Calls 2

samefileMethod · 0.80
statMethod · 0.45

Tested by

no test coverage detected