shutil.copy2()
  • References/Python/Python/File & Directory Access

shutil.copy2(src, dst, *, follow_symlinks=True) Identical to copy() except that copy2() also attempts

2025-01-10 15:47:30
pathlib.Path.lchmod()
  • References/Python/Python/File & Directory Access

Path.lchmod(mode) Like Path.chmod() but, if the path points to a symbolic link, the symbolic link’s mode is changed

2025-01-10 15:47:30
stat.S_ISCHR()
  • References/Python/Python/File & Directory Access

stat.S_ISCHR(mode) Return non-zero if the mode is from a character special device file.

2025-01-10 15:47:30
tempfile.mkstemp()
  • References/Python/Python/File & Directory Access

tempfile.mkstemp(suffix=None, prefix=None, dir=None, text=False) Creates a temporary file in the most secure manner possible

2025-01-10 15:47:30
filecmp.dircmp.common_funny
  • References/Python/Python/File & Directory Access

common_funny Names in both a and b, such that the type differs between the directories, or names for which

2025-01-10 15:47:30
pathlib.Path.exists()
  • References/Python/Python/File & Directory Access

Path.exists() Whether the path points to an existing file or directory:

2025-01-10 15:47:30
os.path.samestat()
  • References/Python/Python/File & Directory Access

os.path.samestat(stat1, stat2) Return True if the stat tuples stat1 and stat2 refer to the same

2025-01-10 15:47:30
pathlib.Path.read_bytes()
  • References/Python/Python/File & Directory Access

Path.read_bytes() Return the binary contents of the pointed-to file as a bytes object:

2025-01-10 15:47:30
glob.escape()
  • References/Python/Python/File & Directory Access

glob.escape(pathname) Escape all special characters ('?', '*' and '['). This is useful

2025-01-10 15:47:30
pathlib.Path.chmod()
  • References/Python/Python/File & Directory Access

Path.chmod(mode) Change the file mode and permissions, like

2025-01-10 15:47:30