# Download
git clone https://github.com/UnKnownHelp69/mcopy
cd mcopy
# Compile MinGW-w64
gcc mcopy.c cursor.c tools.c -o mcopy
# Compile MSVC
cl main.c cursor.c tools.c /Fe:mcopy.exe /O2 /W3
# add to pathset PATH=%PATH%;C:\path\to\mcopy# Using
mcopy [flags] <source><destination># Copy file into folder
mcopy C:\photo.jpg D:\images
# Rewrite file
mcopy -r C:\file.txt D:\backup\copy.txt
# Copy folder to folder
mcopy D:\projects E:\backup
# Rewrite all files
mcopy -F C:\work D:\work_backup| Flag | Defenition | Example |
|---|---|---|
-r | Replace existing files Overwrites files with the same name | mcopy -r file.txt D:\ |
-R | Replace existing folders Deletes the folder before copying | mcopy -R folder D:\ |
-A | Add to existing folders Copies new files without replacing existing ones | mcopy -A folder D:\ |
-F | Force flag Ignore all = -r + -R | mcopy -F source D:\ |
# Several flags together are acceptable
mcopy -r -A C:\projects D:\backup
mcopy -R -r D:\data E:\archive
mcopy -F C:\work D:\work_backup| Code | Enum | Defenition |
|---|---|---|
1 | fileAccessError | There is no access to an existing file |
2 | readFileError | Reading error |
3 | writeFileError | Writing error |
4 | deleteFileError | Couldn't delete the file |
5 | getFileSizeError | Couldn't get the size |
6 | copyFiletoFileByValidPathesError | Error copying by valid paths |
7 | copyFileToFileError | Error copying a file to a file |
8 | getNameFileError | Couldn't get the file name |
9 | makeNewPathBySourcePathAndDestPathError | Error forming the destination path |
10 | copyFileToFolderError | Error copying a file to a folder |
11 | mallocError | Insufficient memory |
12 | getFolderSizeError | Couldn't get folder size |
13 | createFolderIfNotExistError | Folder creation error |
14 | checkSubFolderError | Error checking the nesting |
15 | copyFolderToFolderError | Error copying folder to folder |
16 | readSizeError | File size reading error |
17 | differentSizeOfCopiedFilesError | The size of the original and the copy do not match |
18 | inputError | Invalid command line arguments |
19 | undefinedError | Unknown error |
20 | deletFullFolderError | Error deleting a folder completely |
21 | infRecursionError | Trying to copy a folder to itself |
22 | deleteFolderError | Empty folder deletion error |