This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Re: ln -f changes permissions on NT
- To: "'cygwin at sourceware dot cygnus dot com'" <cygwin at sourceware dot cygnus dot com>
- Subject: Re: ln -f changes permissions on NT
- From: Chris Faylor <cgf at cygnus dot com>
- Date: Mon, 18 Sep 2000 18:47:22 -0400
- References: <DDFE2CAB87ECD311B02D0000929695E20EBCDB@WOTAN>
- Reply-To: cygwin at sources dot redhat dot com
On Mon, Sep 18, 2000 at 03:53:43PM -0400, Tweedy, Laura wrote:
>I am running into permission problems with ln -f. I have a file that
>is read-only and I want it to remain so. I am making a hard link to
>it in another location. This link is done in a makefile which uses
>ln -f to make the link. The link works fine, but if making the target
>requires that it be removed first, the permissions become read-write.
I don't see an easy way around this. The file system semantics for
Windows are different from UNIX. On UNIX, you can unlink a file which
has read only permission. AFAIK, you can't do that on Windows without
first changing the permissions of the file.
So, if you change the permissions to unlink a file you also change the
permissions of any files hard linked to that file, just like UNIX. The
problem is that there is no way of knowing (or at least I don't know how
to find out) which files are linked to the file that you're deleting.
Like I said, I don't see any easy way around this problem but if someone
has a solution, please post it here.
cgf
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com