Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com From: Chris Faylor Date: Mon, 18 Sep 2000 18:47:22 -0400 To: "'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'" References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.6i In-Reply-To: ; 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