Download utils/os_utils.py from Ccbb121/ProDiff: direct link, hf CLI and curl.
- Browser
- Download file 524 Bytes
-
https://huggingface.co/datasets/Ccbb121/ProDiff/resolve/main/utils/os_utils.py
- Command line
-
hf download hf://datasets/Ccbb121/ProDiff/utils/os_utils.py
-
curl -L -o os_utils.py https://huggingface.co/datasets/Ccbb121/ProDiff/resolve/main/utils/os_utils.py
524 Bytes
| import os | |
| import subprocess | |
| def link_file(from_file, to_file): | |
| subprocess.check_call( | |
| f'ln -s "`realpath --relative-to="{os.path.dirname(to_file)}" "{from_file}"`" "{to_file}"', shell=True) | |
| def move_file(from_file, to_file): | |
| subprocess.check_call(f'mv "{from_file}" "{to_file}"', shell=True) | |
| def copy_file(from_file, to_file): | |
| subprocess.check_call(f'cp -r "{from_file}" "{to_file}"', shell=True) | |
| def remove_file(*fns): | |
| for f in fns: | |
| subprocess.check_call(f'rm -rf "{f}"', shell=True) |