r/C_Programming • u/QuirkyXoo • Jul 06 '26
dtcopy: a command line Windows utility
Hi everyone, this post is about dtcopy, a command-line backup utility for Windows.
The program allows conditional copying of entire directories based on file timestamps or a defined date.
Its main purpose is to handle directory backups (including subdirectories), either updating existing files or copying them from scratch.
It also features a basic versioning mechanism and can generate a single compressed archive of the project and its dependencies.
The project is open-source and also includes a pre-compiled binary package with a simple installer. The README.md contains a full description.
GitHub repository: https://github.com/lpierge/dtcopy
Now about the source code, most of the project files are named with the .cpp extension just to trick the compiler, because I'm used used to writing not in pure C but in "C with classes". That means the C code I write may use some basic object-oriented concepts (classes, inheritance, polymorphism), but it completely avoids modern C++ features (no STL, no templates, no namespaces, etc.). In other words, most of the code remains very close to traditional, low-level procedural C programming.
I would like to make it clear because I understand that such C code doesn't fit perfectly in this subreddit, nor in the modern C++ subreddit, so if you think it leans too far into OOP for this specific community, I'm sorry and feel free to remove the post.
Thoughts, feedback or critiques are welcome.
Luca P.
View all comments
Show parent comment
1
u/QuirkyXoo Jul 07 '26
Thanks. The main code (dtcopy.cpp) is almost pure C internally, but some of the objects used (such as list management, file searching and wildcard-based filtering) are classes. However, even these classes internally contain C code, not C++.
In other words, the classes are simple wrappers around the C code, and about half of the source code is pure C (as for datetime.c, fastrand.c, getopt.c, strings.c, traceexpr.c, and win32api.c). In particular, the win32api.c file contains several Win32-specific functions written in pure C, including two basic functions for ANSI/Unicode conversions.