将 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.1.tar.gz
(15.0 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.1-py3-none-any.whl
(18.5 kB
view details)
File details
Details for the file save_c-1.2.1.tar.gz.
File metadata
- Download URL: save_c-1.2.1.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89bc1a14a0cbfbd9139376964447cc13fef2cc2b89b2b0c953699ae47472a733
|
|
| MD5 |
cd1ed6a652813bbd08bef8b66461a3fe
|
|
| BLAKE2b-256 |
fa0d107f03952411dc89279fc300710f92dfd7248e1f71b8d2e6646ba714a9d3
|
File details
Details for the file save_c-1.2.1-py3-none-any.whl.
File metadata
- Download URL: save_c-1.2.1-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 |
3394419c9d1ac57afc818267bcf24394a4c872dd1088a4e551958d3d329817b5
|
|
| MD5 |
090d4a49863ac9613a4fffecdd702067
|
|
| BLAKE2b-256 |
10bea8ca76bb47ab23ee12445ff2ef89ccad225e2705b24d54eee14a8d3ef2c9
|