nipoppy.utils.fileops¶
File operations utility functions.
Module Contents¶
- nipoppy.utils.fileops.copy(source, target, dry_run=False, exist_ok=False)¶
Copy a file or directory.
Raise an error by default if the target path already exists.
- Parameters:
source (pathlib.Path)
target (pathlib.Path)
exist_ok (bool)
- nipoppy.utils.fileops.mkdir(dpath, dry_run=False)¶
Create a directory (including parents).
Do nothing if the directory already exists.
- Parameters:
dpath (pathlib.Path)
- nipoppy.utils.fileops.movetree(source, target, dry_run=False)¶
Move directory tree.
- Parameters:
source (pathlib.Path)
target (pathlib.Path)
- nipoppy.utils.fileops.rm(path, dry_run=False)¶
Remove a file, directory, or symlink.
- Parameters:
path (pathlib.Path)
- nipoppy.utils.fileops.symlink(source, target, dry_run=False)¶
Create a symlink: target -> source.
- Parameters:
source (pathlib.Path)
target (pathlib.Path)
- nipoppy.utils.fileops.logger¶