DisposableDir 是一款安全刪除工具。程式會自動建立一個拋棄式資料夾,使用者將欲銷毀的檔案移入後,程式以隨機亂數複寫檔案內容,再將整個資料夾永久刪除,降低資料被還原的可能性。
- 自動建立拋棄式資料夾:指定父目錄後,程式自動在該路徑下建立
DisposableDir,無需手動操作。 - 安全複寫:對每個檔案寫入隨機亂數(最多 1MB),並強制
fsync確保資料落盤後再刪除。 - 驗證機制:執行銷毀前需輸入隨機驗證碼,防止誤操作。
- 執行摘要:完整回報成功、失敗檔案數量與清單,以及總執行時間。
- 全域退出:任意輸入點輸入
--exit即可安全離開程式。
請至 Release 下載 DisposableDir_vX.X.X.exe。
- 啟動:
- 直接執行執行檔:
直接雙擊或執行
DisposableDir_vX.X.X.exe,程式會開啟黑色終端視窗。 - 由程式碼啟動:
pip install -r requirements.txt python main.py
- 直接執行執行檔:
直接雙擊或執行
- 功能介紹:
- 建立拋棄式資料夾:
輸入父目錄路徑,程式自動在該目錄下建立
DisposableDir0(若已存在則自動遞增編號)。將欲銷毀的檔案移入此資料夾後,返回程式繼續操作。 - 安全銷毀: 按下 Enter 後,程式掃描資料夾內所有檔案並顯示數量與總大小,輸入畫面顯示的隨機驗證碼確認後,依序對每個檔案執行複寫並強制落盤,完成後刪除整個資料夾,最終顯示執行摘要。
- 請先閱讀以下開發須知並遵守所用條款。
- 請運行以下指令複製此倉庫至您的本地電腦:
git clone https://github.com/294Ryan/DisposableDir.git
- 使用語言:
- Python 3.9+
- 安裝必要工具:
- Python 模組:請運行以下指令
pip install -r requirements.txt
- Python 模組:請運行以下指令
- 使用技術:請參見使用技術
- 專案結構:請參見專案結構
- 隨機亂數複寫:使用
random.randbytes()對每個檔案寫入隨機亂數,寫入範圍為min(檔案大小, 1MB)。 - 強制落盤:每個檔案寫入後呼叫
f.flush()與os.fsync(),確保資料真正寫入磁碟而非停留於 OS 快取。 - 安全刪除:所有檔案複寫完成後,使用
shutil.rmtree()刪除整個資料夾。 - colorama:跨平台終端色彩輸出,提供結構化的訊息分級顯示(Info / Success / Warning / Error)。
- PyInstaller:將專案打包為單一
.exe執行檔,無需使用者另行安裝 Python 環境。
DisposableDir/
├── .gitignore # 指定 Git 忽略上傳的檔案
├── icon.ico # 應用程式圖示
├── LICENSE # MIT 授權協議
├── main.py # 主程式
├── main.spec # PyInstaller 打包設定檔
├── README.md # 專案說明文件
└── requirements.txt # Python 依賴套件清單
- 維護者:294Ryan - Github
- 使用條款:
MIT - <!> 敬請在本專案所用條款之允許範圍內進行使用。且任何因操作疏失或不當使用造成的後果請自負。
DisposableDir is a secure file deletion tool. It automatically creates a disposable directory where users can place files for destruction. The program then overwrites the file contents with random bytes before permanently deleting the entire directory, minimizing the possibility of data recovery.
- Automatic disposable directory creation: After specifying a parent directory, the program automatically creates a
DisposableDirat that path — no manual setup required. - Secure overwrite: Writes random bytes (up to 1MB) to each file and forces
fsyncto ensure data is physically written to disk before deletion. - Verification mechanism: Requires entering a randomly generated verification code before destruction to prevent accidental operations.
- Execution summary: Reports the count and list of successfully overwritten and failed files, along with total execution time.
- Global exit: Enter
--exitat any input prompt to safely terminate the program.
Download DisposableDir_vX.X.X.exe from Release.
- Launch:
- Execute the executable file directly:
Double-click or run
DisposableDir_vX.X.X.exe. A terminal window will open. - Launch from code:
pip install -r requirements.txt python main.py
- Execute the executable file directly:
Double-click or run
- Feature Introduction:
- Create a disposable directory:
Enter a parent directory path. The program automatically creates
DisposableDir0inside it (auto-increments if the name already exists). Move the files you want to destroy into this folder, then return to the program to continue. - Secure destruction: Press Enter to scan all files in the folder, displaying the file count and total size. Enter the randomly generated verification code shown on screen to confirm. The program then overwrites each file and forces a disk flush, deletes the entire directory, and displays an execution summary.
- Please read the following development guidelines and comply with all applicable terms.
- Please run the following command to clone this repository to your local machine:
git clone https://github.com/294Ryan/DisposableDir.git
- Programming Languages:
- Python 3.9+
- Required Tool Installation:
- Python Modules: Please run the following command
pip install -r requirements.txt
- Python Modules: Please run the following command
- Technologies Used: Please refer to Technologies Used
- Project Structure: Please refer to Project Structure
- Random byte overwrite: Uses
random.randbytes()to write random data to each file, coveringmin(file size, 1MB). - Forced disk flush: Calls
f.flush()andos.fsync()after each file write to ensure data is physically committed to disk rather than remaining in the OS cache. - Secure deletion: After all files are overwritten,
shutil.rmtree()is used to delete the entire directory. - colorama: Cross-platform terminal color output providing structured message-level display (Info / Success / Warning / Error).
- PyInstaller: Packages the project into a single
.exeexecutable, requiring no Python installation on the user's machine.
DisposableDir/
├── .gitignore # Specifies files for Git to ignore
├── icon.ico # Application icon
├── LICENSE # MIT License
├── main.py # Main program
├── main.spec # PyInstaller build configuration
├── README.md # Project documentation
└── requirements.txt # Python dependency list
- Maintainer: 294Ryan - Github
- Terms of Use:
MIT - <!> Please use this product only within the scope permitted by the terms and conditions of this project. You are solely responsible for any consequences arising from operational errors or improper use.