Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
From: Chris Faylor <cgf@cygnus.com>
Date: Mon, 18 Sep 2000 18:47:22 -0400
To: "'cygwin@sourceware.cygnus.com'" <cygwin@sourceware.cygnus.com>
Subject: Re: ln -f changes permissions on NT
Message-ID: <20000918184722.D23512@cygnus.com>
Reply-To: cygwin@sources.redhat.com
Mail-Followup-To: "'cygwin@sourceware.cygnus.com'" <cygwin@sourceware.cygnus.com>
References: <DDFE2CAB87ECD311B02D0000929695E20EBCDB@WOTAN>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.6i
In-Reply-To: <DDFE2CAB87ECD311B02D0000929695E20EBCDB@WOTAN>; from l.tweedy@clairvoyancecorp.com on Mon, Sep 18, 2000 at 03:53:43PM -0400

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

