[NTLUG:Discuss] Is there a way to change permissions of a link
Steve Baker
sjbaker1 at airmail.net
Tue Oct 31 19:09:11 CST 2000
Neil Aggarwal wrote:
>
> Hello:
>
> I have several symbolic links set-up for a user of mine.
> They point to some files in the same directory.
>
> I want him to be able to copy new files into the targets
> of the links, but I dont want him to over-write the links
> themselves.
>
> Unfortunately, the links are mode 777.
>
> How do I change the mode of the links without affecting the
> targets?
OK - you have a couple of misconceptions:
* The mode of the links is irrelevent - Linux doesn't use them.
The mode is always that of the destination file.
* When you copy (using 'cp' for example) a file to either the
symlink *or* the think it links to, the change will go to the
file itself and the symlink will still point to it.
* However, if you DELETE a symbolic link, it'll only delete the
link.
Hence: BEWARE - some programs that "overwrite" files don't
literally do that, they delete the file and then create a
new one of the same name. If one of those kinds of programs
is told to "overwrite" the SymLink, then it'll "break" the
link and you'll end up with two completely separate files.
Fortunately, not many programs make that mistake.
--
Steve Baker HomeEmail: <sjbaker1 at airmail.net>
WorkEmail: <sjbaker at link.com>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sourceforge.net
http://tuxaqfh.sourceforge.net
http://tuxkart.sourceforge.net
http://prettypoly.sourceforge.net
More information about the Discuss
mailing list