https://github.com/matthias-p-nowak/binmulticopy
copy common used program files which might be in use
https://github.com/matthias-p-nowak/binmulticopy
Last synced: 2 months ago
JSON representation
copy common used program files which might be in use
- Host: GitHub
- URL: https://github.com/matthias-p-nowak/binmulticopy
- Owner: matthias-p-nowak
- License: bsd-2-clause
- Created: 2024-02-06T13:58:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-06T16:05:25.000Z (over 1 year ago)
- Last Synced: 2024-02-07T15:52:59.838Z (over 1 year ago)
- Language: C#
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BinMultiCopy
Copies common used program files which might be in use.## Background
Files that are in use like DLL's and programs can't be overwritten, since the running program has a lock on those files.
**Solution:** Locked files are locked for writing and therefore cannot be changed. However, it is possible to change the filename by setting the extension to *000* or similar. The normal rename command is also prevented by the lock. Hence, the filename must be *replaced*. This is a change in the directory, not on the file.
## Usage
It is simple, just use the command line with:
~~~SHELL
BinMultiCopy.exe {} -t {}
~~~
The first term is the multi copy executable.The next arguments can either denote files or directories to be copied. From directories only files ending in *exe*, *dll*, *json*, or *config* are copied.
The next argument is a simple ```-t``` that separates the source directories/files from the target.
The final arguments are a list of directories to copy the discovered files to.
## inner workings
The program first tries to copy the file into the target directory. If that fails, it copies the file into the directory with extension ".tmp". Then it does a file replacement, renaming the locked target file to ".000" and simultaneously the ".tmp" file into the target file. At most 5 attempts are made.