delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/08/01/16:21:52

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
X-Injected-Via-Gmane: http://gmane.org/
Path: not-for-mail
From: Sam Steingold <sds AT gnu DOT org>
Newsgroups: gmane.os.cygwin
Subject: Re: bug: hard links to soft links do not work
Date: 01 Aug 2002 16:21:43 -0400
Organization: disorganization
Lines: 35
Message-ID: <sa0it2ul488.fsf@glip.premonitia.com>
References: <sa0eldimogw DOT fsf AT glip DOT premonitia DOT com> <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20020801123520 DOT 01f97010 AT pop3 DOT cris DOT com> <20020801200325 DOT GC27689 AT redhat DOT com>
Reply-To: sds AT gnu DOT org
NNTP-Posting-Host: 65.114.186.226
Mime-Version: 1.0
X-Trace: main.gmane.org 1028233269 22856 65.114.186.226 (1 Aug 2002 20:21:09 GMT)
X-Complaints-To: usenet AT main DOT gmane DOT org
NNTP-Posting-Date: Thu, 1 Aug 2002 20:21:09 +0000 (UTC)
X-Attribution: Sam
X-Disclaimer: You should not expect anyone to agree with me.
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> * In message <20020801200325 DOT GC27689 AT redhat DOT com>
> * On the subject of "Re: bug: hard links to soft links do not work"
> * Sent on Thu, 1 Aug 2002 16:03:25 -0400
> * Honorable Christopher Faylor <cgf AT redhat DOT com> writes:
>
> I don't think this is a 'ln' problem.  It's a cygwin problem.  If
> cygwin is doing the wrong thing then it should, as Sam said, either be
> made to work or fail, not provide binary gobbledegook.
> 
> If this was to be made to work correctly, it would be pretty low level
> in cygwin in the path_conv and symlink_check methods.
> 
> It would be much easier to fail in this scenario rather than make it
> work correctly, I think.

actually, this is very easy:

(defmethod hard-link :around (from to)
  (if (symbolic-link-p to)
      (symbolic-link from (resolve-symbolic-link to))
      (call-next-method)))

i.e., when the target is a symlink, you symlink to its target.

think of a symlink as if it had no inode (like it is on a real FS),
i.e., just a special dirent pointing to the target.
Then the hardlink of a symlink is another symlink pointing to the same
place, since the nature of hardlink is to create a file which is
indistinguishable from the target.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Of course, I haven't tried it. But it will work.    - Isaak Asimov



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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