Skip to main content

将 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.0.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

save_c-1.0.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file save_c-1.0.0.tar.gz.

File metadata

  • Download URL: save_c-1.0.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.9

File hashes

Hashes for save_c-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c419351dc0febb8adb06822989425a343de92ded192f2e526ccc906f88a06dcd
MD5 a16e674fdd9fbf82fbee0179be672ea2
BLAKE2b-256 bc91692f40f7d724a56f1e3a4aed7724fcf4cf08d17932f21532f92c471a1f07

See more details on using hashes here.

File details

Details for the file save_c-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: save_c-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.9

File hashes

Hashes for save_c-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffab70ded2ff7e2154a9809557b64248bc06ea904ea20846ca043d6a8c379da4
MD5 c3072847f32d335dcd4ba32a6b2e1258
BLAKE2b-256 d1911581ea9d3df17244b94fa58b5d4a36a68757c32bcb83d5d3aea3b8dd32ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page