将 C 盘目录迁移到 D 盘并创建软链接,安全释放 C 盘空间
Project description
save-c
将 C 盘目录迁移到 D 盘并创建目录软链接(symlink),安全释放 C 盘空间。
先完整拷贝到 D 盘,确认成功后删除 C 盘原目录,再创建软链接指回 D 盘。 拷贝出错时自动清理残缺文件,不会留下脏数据。
安装
pip install save-c
或开发模式安装(编辑后即时生效):
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
配置
可以通过 GUI 配置关键内容,比如扫描目录以及迁移的目标目录等。
savec config
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.2.2.tar.gz
(15.1 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.2.2-py3-none-any.whl
(18.5 kB
view details)
File details
Details for the file save_c-1.2.2.tar.gz.
File metadata
- Download URL: save_c-1.2.2.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bb5c178310be19175bb636534e28a45f186bd03b1f2a6ae30f7aba8c7298255
|
|
| MD5 |
3af2c04f7bf3796d9958bd4af9998a16
|
|
| BLAKE2b-256 |
e408478d1680c2e0e5bac87cbe8f324c66b8d9a8574dd2eedce06e38eb9f87f7
|
File details
Details for the file save_c-1.2.2-py3-none-any.whl.
File metadata
- Download URL: save_c-1.2.2-py3-none-any.whl
- Upload date:
- Size: 18.5 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 |
921757a6ac6fdd75aa4dc2b2241f545dce752277ffcdc624620ca34432a56044
|
|
| MD5 |
ee1770033dbd34e11269018e6c846d03
|
|
| BLAKE2b-256 |
90b2ca7695ef22725529a5a644209fbcd30a8127ade244fcb1228460f4dceb6b
|