www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/04/06/07:14:37

Date: Tue, 6 Apr 1999 13:04:42 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Michel de Ruiter <Michel AT smr DOT nl>
cc: "'DJGPP workers'" <djgpp-workers AT delorie DOT com>
Subject: Re: regex question
In-Reply-To: <B0FEA00E82A7D1118BFB00A0CC990278213236@ARGON>
Message-ID: <Pine.SUN.3.91.990406125338.16726M-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 6 Apr 1999, Michel de Ruiter wrote:

> An argument of `*/' matches directories *and* normal files.
> An argument of `*/' _in Bash_ does *not* match normal files, only
> directories.
> 
> I think this difference exists, because the DJGPP command line matching
> routines do not want to stat every filename to see if it is a directory or
> not, because that would mean the minimum executable size would increase too
> much.

The globbing code cannot call `stat' at all, because it's non-ANSI, and the 
globbing code is linked into every executable, so it would pollute the 
ANSI namespace.  But we can look at the attributes returned by `findfirst'.

Did you look at the code that expands wildcards, and if so, can you 
suggest a change that will only return directories in the case of */?

Does anybody know if the Bash behavior specific to Bash, or other Unix 
shells return directories for */?

> DOS also returns files for *.*\, IIRC.

DOS ignores trailing slashes entirely.

> Maybe we should document this somewhere, though. Where?

In the same place where the wildcard expansion is documented.  `glob's 
Info page seems like a good place.

> Also, is noticed `abC*' expands to `ABC', whereas `aBc*' expands to `abc'.
> Why?

I cannot reproduce this behavior.  Please tell whether this was on DOS or 
Windows 9X, which files that match these patterns exist, and how did you 
expand them (with what program?).  The setting of FNCASE in the 
environment is also an important information.

- Raw text -


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