Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

coc - Copy On Change

A small utility to compare if two files are different, and update the destination only if necessary (eg. to avoid invalidating buildsystem cache).

Basic thing with bash, including support for src being stdin (expressed '-'):

usage examples

concat input files

cat src/*.c | ./coc - build/all-sources-as-single-file.c

mvrm mode - refresh .o file only when needed

This illustrates the use of mvrm mode, that is as mv, but removes the source file when there is no change.

tmp=$(mktemp)
gcc -c file.c -o $tmp
./coc $tmp file.o mvrm

(a bit contrived example, as this does not prevent recompilation on next build attempt (source would be kept newer than .o) but at least prevents invalidation of linking the .o together into bigger thing).

About

copy file, but only when changed

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages