Le 07/05/2010 16:02, Peng Yu a écrit : > I can copy the whole > directory and then modify one file in the newly copied N files. But > I'll lose track of which file has been changed later on, which is > important to me.
You will not lose track of the changed files: just run a recursive diff comparing the old and new directories and you will see what was/has changed (this is actually the poor man's version control system). > Suppose I have N files in a directory that does some job. Lets say M > (<N) files are primary files and N-M files are derived from these M > files (say, there are a number of programs, each takes some of the M > files to generate some of the N-M files). > [...] > Instead, I'd rather create symbolic link for all the N-M-1 primary > files but copy only one remaining file and modify it. Remember, I > can't tell which are primary files and which are derived files. So I > can not do so. > > One solution is create symbolic link to N-1 files as long as I can > overload '>' and '>>' and the open file function call. So you are really trying to re-invent some copy-on-write/versioning file system by hacking symbolic links and redirections. This looks like a lot of pain. You'd better start by looking at existing solutions; even if none is ideal for your case, you would at least leverage the existing knowledge and experience in this field instead of starting from zero. > Let me know if you have any thought on solving this problem. Since you are using the wrong tool for the job I am afraid you are going to be rather alone on this road. Cheers, Marc