delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/09/18/18:49:00

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Mon, 18 Sep 2000 18:47:22 -0400
To: "'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: ln -f changes permissions on NT
Message-ID: <20000918184722.D23512@cygnus.com>
Reply-To: cygwin AT sources DOT redhat DOT com
Mail-Followup-To: "'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>
References: <DDFE2CAB87ECD311B02D0000929695E20EBCDB AT WOTAN>
Mime-Version: 1.0
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 AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019