get lock on semaphore file for (file1, file2) { open read and copy close unlink } release semaphore file lock