GBFileCopier
A free, open-source file copy utility for Windows and macOS, inspired by TeraCopy: copies verified by reading back from disk, no half-written files, and a command line as well as a window.
The problem
Copying many files, or big ones, with the operating system’s own tool has a flaw everyone knows: if something goes wrong halfway you can’t tell what arrived and what didn’t, and often a single error stops everything. TeraCopy solves the problem on Windows, but there’s nothing equivalent, free, that works the same way on a Mac too. So I decided to write it myself: GBFileCopier, for Windows and macOS, under the GPL.
What it does
- Copy and move, with a window where you drop files and folders, or a command line
(
gbcopy) for scripts. - Errors don’t stop the job: files that fail are skipped, listed with the reason, and can be retried.
- Checksum verification, computed while copying, with several algorithms to choose from (from fast ones like xxHash to the classic MD5, SHA-1, SHA-256).
- Safe move: a source file is deleted only after its copy has been verified. On the same disk a move is just a rename, so it’s instant.
- Name conflicts with rules (overwrite, skip, keep both, only if newer), also applied to all later conflicts.
- Paste from the Finder or Explorer: copy (or cut) a file in the file manager and paste it into the program with the usual key combination.
- Pause and cancel during long copies.
- English and Italian, plus a light, dark or system theme that changes instantly without a restart.
An honest copy
The heart of the project is a simple question: how do I know the copy is really identical? A naive check re-reads the file just written, but the operating system answers from its memory cache, where the data is still what was just written: the comparison always succeeds, even if the disk got something wrong. So verification uses each system’s native functions and reads from the disk: on Windows by opening the file unbuffered, on macOS by having the cache discarded. The same goes for flushing data: rather than trusting the system, it asks for the data to reach permanent storage (on a Mac, the command that also empties the drive’s own cache).
Another rule: every file is written under a hidden temporary name, checked, and only at the end renamed into place. An interrupted copy never leaves half-written files and never damages an existing one.
How it’s built
A C# project on .NET 10, in four parts: the copy engine (system-independent), a layer of native operations for Windows and macOS, the command line, and the desktop app with Avalonia, the UI library that works on both. Tests run on Windows and on macOS, Intel and Apple Silicon, with an automatic check that no interface text is missing in a language and that the sentences’ placeholders match.
How I work on a project I want to publish
On this repository I asked myself for more discipline than usual. The main branch is protected: you work on a separate branch, open a pull request, and merge only with the automatic checks green on every platform. An instructive stumble: I merged a pull request that depended on another by deleting the base branch, and GitHub closed the dependent one. Now the retargeting is done first, and the deletion only afterwards.
There’s also a small lesson on testing on a Mac: querying windows with AppleScript froze everything waiting for a permission prompt aimed at me, and interface tests are now done with images rendered without a screen.
From repository to package
A program nobody can install doesn’t exist. So I also built the distribution: on a Mac a single app for Intel and Apple Silicon, packed in a disk image with the link to Applications; on Windows an installer (per user, in English and Italian) plus a portable version. A single version tag on GitHub triggers building everything and publishes a release with the files’ checksums.
The part that took the most care is signing. Up to 0.3.0 the Mac app only had an “ad hoc” signature, with the usual system warning; 0.3.1 is the first signed with a developer certificate and notarized by Apple, so it opens without warnings. On Windows the installer is still unsigned and the system warns about an unknown publisher. For Windows I had chosen the SignPath Foundation programme, free for open-source projects, because the alternatives were too expensive (hundreds of euros a year), unavailable to individuals in Europe, or only workable by hand, with a phone code for every signature, which rules out an automated process. I prepared everything in the repository and sent the application. On 27 October it was declined: the programme requires an already visible project (stars, contributors, articles, activity over time), and this one is a few days old. It can be resubmitted when there’s some, or I can switch to a paid subscription, which costs from hundreds to thousands of dollars a year. I chose to stay unsigned on Windows for now: in the repository and the release notes I state it openly, rather than leave a sentence promising a signature that isn’t there. The signing steps stay in the release process, switched off, ready for when they’re needed.
Integration with the system
A copy you can only start from a separate app is worth half as much. So the versions after the first added integration with the file managers:
- On Mac, a Finder extension (an entry in the context menu), dropping onto the Dock icon, and a single open instance.
- On Windows, an entry in Explorer’s context menu, the “Send to” entry and again a single instance. (On Windows 11 the entry is under “Show more options”; the modern menu would need a signed package.)
Several jobs at once, and self-updating
With 0.4.0 every copy or move becomes a job in a list: the window stays free for the next one even while the others run, and requests from the Finder or Explorer are no longer ignored during a copy. Jobs to the same destination disk run one after another, in order, while jobs to different disks run together: no point making two copies fight over the same drive head.
Then automatic updates. At first start the app asks for permission to check for news; if there is some, it offers “Install and restart”. I chose to write the mechanism myself rather than use a library, to control everything: it downloads from the releases page, checks the checksum and the signature, and installs only when no jobs are running. On Mac a small helper replaces the app and relaunches it; on Windows it runs the installer silently. I really tested it with a “pretend” version, making the app believe it was older.
When caution costs too much: copying to a NAS
A report brought it out: copying many small files to a NAS ran at 5 MB a second. I measured on a
shared folder at home, with 150 files of 2 MB: 137 seconds with a forced flush to disk after
each file, 27 without, 22 with the system’s plain cp. The reason is that the flush forces
the NAS to write each file to its disks before answering, and it does so one file at a time;
overlapping the flushes didn’t help (from 19 to 14 seconds on 40 files). So on network
shares the per-file flush is now off by default, with a checkbox in the settings (and a
command-line option) to switch it back on: where absolute safety matters, you choose. It’s the
same philosophy as at the start, applied with common sense: caution is worth it when the risk is
real, not at any price.
The details you notice when using it arrived too: a list of each job’s files with their destination while they run (before, results only showed at the end), speed and time left on a line of their own because with a NAS’s long names they were cut off, and on Windows an option to start the copy with GBFileCopier just by pressing Ctrl+V in Explorer, without going through the menu.
A fast copy without losing safety, on the Mac
The Mac had its own version of the NAS story. Forcing each file to permanent storage costs about
23 milliseconds on the Mac’s disk, whatever the size: copying two thousand small files took 44
seconds, against 1.3 for cp. The solution isn’t removing safety but giving it a fair price: on
Mac every file now gets a write barrier (its data reaches the disk before anything written
after it, so the final rename never shows data that isn’t there), and at the end of the job a
single full flush for all. The result: from 44 to 4 seconds on two thousand files, from 4 to
under 1 second on a hundred and fifty 2 MB files. Windows has no equivalent barrier: I measured
the cost (a few milliseconds per file) and left it as is, because there the better lever would be
copying more small files in parallel.
Small files, several at a time
That lever is now pulled. Each small file spends most of its time waiting for the file system
(create, flush, rename, timestamps), so runs of consecutive files under 16 MB are copied up to
four at a time, while a big file is still copied alone, since one already keeps the disk
busy. The part that needed care was keeping the promises of a sequential copy. Results still
come back in the plan’s order, whatever order the copies finish in. Conflicts are resolved one at
a time, so dialogs come one by one and “apply to all” covers the next files. And a file and its
folder planned twice are still copied one after the other. Review caught a real trap: with
IMG.jpg already present, copying IMG.jpg and a file genuinely named IMG (2).jpg at the same
time made both want the name IMG (2).jpg, a false failure on some file systems and a silent
overwrite on others. Names already given are now reserved, and the new copy becomes
IMG (3).jpg. On the Mac, two thousand tiny files went from 3.0 to 1.7 seconds, with identical
copies; I haven’t yet measured it on a NAS or on Windows, which is where it should matter most.
Checksum files, to prove it later too
Verifying right after the copy is not the same as being able to prove, months on, that a folder
is still intact. So a copy can now write a checksum file into the destination, in the
formats other tools understand (sha256sum, md5, and SFV for the CRC32 classic), and a
Verify Checksum File… command reads one back and reports files that differ or are missing.
Verification runs as an ordinary job in the queue. The review of the code against both systems
found what you’d expect from lists passing between machines: a list made on Windows has
backslashes in its paths, and a name with an accent can be stored in two different Unicode
forms on a Mac and on an NTFS disk, so the same file wouldn’t be found. Both are now handled, as
are lists that aren’t UTF-8, the algorithm is guessed from the file name or the hash length, and
a checksum file that can’t be written makes the command-line tool exit with an error. Checked on
the Mac against shasum, md5 and crc32; lists exchanged between Windows and Mac are still to
be tried on the real machines.
Status
On 19 November came 0.6.1, a maintenance-only release: nothing new for people using the program, but the compiler is pinned to an exact version in the automatic checks and the release builds, and the release process now reviews all the work since the last version before bumping the number. A second automatic reviewer checks that no secrets slip into pushes and releases.
From the first version to 0.6.0 in six days (24-30 October 2026): from the Finder and Explorer integrations and the Mac signing of 0.3.1, to the job queue and automatic updates of 0.4.0, to the polish of 0.4.x, the Windows Ctrl+V of 0.5.0, the Mac write barrier of 0.5.1, the parallel copy of small files and Help-menu donation of 0.5.2, and the checksum files of 0.6.0. On 30 October I tried 0.5.2 on the real machines and everything worked: parallel copy to a NAS from Windows, the in-app update (on a PC with the program hidden in the tray, and on the Mac installed in the Applications folder), the all-users install with the administrator prompt refused, starting at sign-in, and keyboard responsiveness during a big job. Windows remains unsigned, and I state it. Later: the modern Windows 11 menu, extended attributes and permissions, instant clones on APFS and exportable reports.
Stack
C# · .NET 10 · Avalonia · GitHub Actions · GPL-3.0