delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/12/02/08:39:03

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <20081202120840.GM12905@calimero.vinschen.de>
References: <4934461E DOT 5040708 AT t-online DOT de> <20081202120840 DOT GM12905 AT calimero DOT vinschen DOT de>
Date: Tue, 02 Dec 2008 14:38:01 +0100
Reply-To: "Christian Franke" <Christian DOT Franke AT t-online DOT de>
To: cygwin AT cygwin DOT com
Subject: Re: Avoid duplicate names in /proc/registry (which may crash find) ?
From: "Christian Franke" <Christian DOT Franke AT t-online DOT de>
Message-ID: <1L7VRx-1n5Cvw0@fwd08.aul.t-online.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

Corinna Vinschen wrote:
> ...
> 
> Some random thoughts:
> 
> - Do we really need d_type support in the registry?  How often is that
> actually used?
> 

/proc/registry is probably rarely used, so d_type support is not
important.
But adding it would be trivial and the effect is significant:
Speed up of  "oldfind" (which does not crash :-) is >= 2.


> - If find crashes in this situation, isn't this a bug in find which
> should be fixed in find?
> 

Yes. As far as I understand POSIX, it does not require "directory
snapshot" semantics for readdir(). So if e.g. a directory "foo" is
replaced by a file "foo" during a readdir() sequence, duplicate names
with different d_type may occur (at least in theory :-)


> - /proc/registry is a convenience for reading the registry.  Due to
> some funny definitions of the registry it's not a full solution.  You
> can't write this way, you can't even access the "(Default)" key
> values.

Access to (Default) works for me with "/proc/registry/.../key/@"

> I personally don't worry if some border cases don't work.  For the
> border cases and for the full access we have regtool.
> 
> Having said that, I really don't know what's the best solution for
> these problems would be.  None of the above ideas are very attractive.
> For instance, in idea 1, the path would actually be
> 
> /proc/registry/HKEY_LOCAL_MACHINE.key/SOFTWARE.key/Cygwin.key/blub.val
> 

or:

3.  Add an extension (describing its type) to value only:

/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Cygwin/blub.type

But then a possible "somekey.type" should be escaped ...


> Shouldn't we rather defer these border cases to regtool?
> 

Yes, further enhancements to /proc/registry are probably not worth the
effort.

Hmm... "/proc/registry/..." pathnames as an alternative for the
KEY/VALUE parameters of regtool would allow to use shell tab-completion
and therefore enhance usability (?).

Christian




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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