bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to overwrite a symbolic link?


From: Peng Yu
Subject: Re: How to overwrite a symbolic link?
Date: Fri, 7 May 2010 10:02:02 -0500

On Fri, May 7, 2010 at 9:26 AM, Marc Herbert <Marc.Herbert@gmail.com> wrote:
> Le 06/05/2010 15:53, Peng Yu a écrit :
>> Suppose that I have a symbolic link link1 pointing to file1. When I
>> write to link1, I don't want file1 change. I want it to remove the
>> link generated a new file and write to it.
>
> This is a very strange question. Symbolic links are expressly designed
> to fool everyone. Why are you using symbolic links if you do not want
> to be fooled?
>
> Please give more details about what you are trying to do.

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). For my problem, there is no
easy way, for example to use file suffix, to figure which of these N
files are primary and which are derived.

Suppose I need to modify one primary file slightly to do something a
little bit different. But I still need to do the original job,
therefore I need to keep it the original M files. 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.

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.

This is why I ask the question in the OP. Let me know if you have any
thought on solving this problem.

-- 
Regards,
Peng




reply via email to

[Prev in Thread] Current Thread [Next in Thread]