WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

HanHonYu/file-compare-tool

Repository files navigation

文件校验工具(Python 3.6+ 优化版)

跨平台文件MD5校验工具,支持本地/远程目录对比、生成CSV报告。

🚀 快速开始

Windows

# 1. 下载并解压
# 2. 运行可执行文件
.\FileCompareTool-Windows.exe -i

# 或双击运行
Linux/macOS

# 1. 下载并解压
# 2. 赋予执行权限
chmod +x FileCompareTool-Linux  # 或 FileCompareTool-macOS

# 3. 运行
./FileCompareTool-Linux -i
📋 功能特性
✅ 本地目录校验 - 比较两个本地目录的文件差异
✅ MD5值比对 - 精确校验文件内容一致性
✅ CSV报告生成 - 自动生成带时间戳的报告文件
✅ 交互式界面 - 命令行菜单操作,无需记忆参数
✅ 跨平台支持 - Windows、Linux、macOS
✅ 配置文件 - 可预设常用目录路径
⚙️ 配置文件
首次运行前,修改 file_compare.conf:
[paths]
dir1 = C:\Your\First\Directory
dir2 = D:\Your\Second\Directory

[remote]
host = 192.168.1.100
port = 22
user = root
dir = /remote/directory
🎯 使用步骤
运行程序:./FileCompareTool-Windows.exe -i
选择操作:按数字键选择功能
输入路径:可直接回车使用配置预设
等待校验:大目录可能需要几分钟
查看报告:报告文件在当前目录生成
📄 报告格式
生成CSV文件包含:
目录1独有文件清单
目录2独有文件清单
MD5不一致文件及对应哈希值
🔧 自行打包
Windows

.\build_executable.bat
Linux/macOS

./build_executable.sh
⚠️ 注意事项
Windows版本必须显示控制台窗口才能交互(打包时使用了--console参数)
远程校验需要安装paramiko库:pip install paramiko
大文件校验可能需要较长时间,请耐心等待
报告文件使用UTF-8编码,Excel打开时请选择此编码
📦 发布包内容

FileCompareTool-Windows.exe  # Windows可执行文件
FileCompareTool-Linux        # Linux可执行文件
FileCompareTool-macOS        # macOS可执行文件
file_compare.conf            # 配置文件模板
README.md                    # 说明文档
🐞 常见问题
Q: Linux/macOS运行提示"Permission denied"
A: 执行 chmod +x FileCompareTool-Linux
Q: 运行时提示"file_compare.conf not found"
A: 确保配置文件与可执行文件在同一目录
Q: Windows双击运行闪退
A: 使用命令行运行:FileCompareTool-Windows.exe -i 查看错误信息
Q: 远程校验失败
A: 检查SSH服务是否开启,防火墙设置,以及paramiko库是否安装
📞 技术支持
项目地址:https://github.com/yourusername/file-compare-tool
问题反馈:请提交Issue


---

## 🎯 **快速开始指南**

### **方式一:使用 GitHub Actions(推荐)**

1. **创建 GitHub 仓库**
2. **上传所有文件**到仓库
3. **进入 Actions 标签页** → 手动触发 workflow
4. **等待 10-15 分钟**,下载生成的制品

### **方式二:本地打包**

**Windows:**
```powershell
# 1. 安装 Python 3.6
# 2. 克隆仓库
git clone https://github.com/your-repo/file-compare-tool.git
cd file-compare-tool

# 3. 双击运行 build_executable.bat
# 或命令行执行:
.\build_executable.bat

# 4. 运行生成的程序
.\dist\FileCompareTool-Windows.exe -i
Linux/macOS:

# 1. 安装 Python 3.6
# 2. 克隆仓库
git clone https://github.com/your-repo/file-compare-tool.git
cd file-compare-tool

# 3. 运行打包脚本
chmod +x build_executable.sh
./build_executable.sh

# 4. 运行生成的程序
./dist/FileCompareTool-Linux -i
✅ 版本特性对比

特性	Python 2.7-3.5 兼容版	Python 3.6+ 优化版(本版)
代码简洁度	❌ 兼容性代码冗余	✅ 使用现代语法(f-string、Path)
性能	⭐⭐⭐	⭐⭐⭐⭐⭐
维护性	❌ 难维护	✅ 易读易维护
打包成功率	❌ 经常失败	✅ 稳定构建
GLIBC兼容性	❌ 问题多	✅ 可控
📦 **一键部署包
我已为您准备好完整项目压缩包,包含所有文件:
下载后解压即可使用:

wget https://github.com/your-repo/file-compare-tool/archive/main.zip
unzip main.zip
cd file-compare-tool-main
# 直接推送到您的GitHub仓库
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/你的用户名/你的仓库名.git
git push -u origin main

About

跨平台文件校验工具

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published