将 C 盘目录迁移到 D 盘并创建软链接,安全释放 C 盘空间
Project description
save-c
将 C 盘目录迁移到 D 盘并创建目录软链接(symlink),安全释放 C 盘空间。
先完整拷贝到 D 盘,确认成功后删除 C 盘原目录,再创建软链接指回 D 盘。 拷贝出错时自动清理残缺文件,不会留下脏数据。
安装
pip install .
或开发模式安装(编辑后即时生效):
pip install -e .
用法
交互模式
直接执行 savec,按提示输入路径:
savec
命令行模式
savec C:\Users\xxx\AppData\Roaming\SomeApp
模拟运行(不做任何实际修改)
savec C:\Users\xxx\SomeDir --dry-run
跳过确认
savec C:\Users\xxx\SomeDir --force
自定义 D 盘保存目录
savec C:\Users\xxx\SomeDir --dest-dir D:\my_moved
扫描模式(批量迁移)
扫描用户目录下的所有子目录,统计占用的磁盘空间,交互式选择要迁移的目录。
savec scan
扫描指定目录
savec scan -d C:\Users\xxx\AppData
扫描并模拟运行
savec scan --dry-run
Python API
from savec import move_and_link
move_and_link("C:\\Users\\xxx\\SomeDir", dry_run=True)
from savec import scan_and_select_interactive
scan_and_select_interactive("C:\\Users\\xxx", dry_run=True)
安全说明
- 只允许操作 C 盘目录。
- 禁止迁移 Windows 系统目录。
- 拷贝失败自动回滚删除残缺文件。
- 删除原目录前会二次确认(除非
--force)。 - 创建和删除软链接、删除目录需要管理员身份运行。
许可证
Apache-2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
save_c-1.1.0.tar.gz
(14.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
save_c-1.1.0-py3-none-any.whl
(17.2 kB
view details)
File details
Details for the file save_c-1.1.0.tar.gz.
File metadata
- Download URL: save_c-1.1.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bb18e31fdc12712eb742b5c41aa328557459623be061e2c43db8c4c00075beb
|
|
| MD5 |
beab3f153defb375010293254e0b49ae
|
|
| BLAKE2b-256 |
986dae41faf6a1190d899f4eef532baeaa80df63e1fbd85dd2f639244beba20f
|
File details
Details for the file save_c-1.1.0-py3-none-any.whl.
File metadata
- Download URL: save_c-1.1.0-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
034122d426b3f493eda9684f871c1c2a7fac14922545c6deaab10853ecd4d51b
|
|
| MD5 |
bcd5cf7b2fcd443f7cb4425df3a82951
|
|
| BLAKE2b-256 |
9b1f5d5c1b0a7f8c93dd30eccedd886db439e2378f96454f1b72a855d1b0c65d
|