TIP: Click on subject to list as thread! ANSI
echo: muffin
to: Wes Garland
from: Bob Jones
date: 2003-06-30 07:55:46
subject: File name processing....

BJ> When I get the chance, I'm going to have to look at how you are 
 BJ> currently handling file name processing in the port.  
 ...
 WG> Here's how it works.. 
 WG>  
 WG> If Maximus/Squish get an actual wildcard from somewhere 
 WG> (e.g. internally generated, config file, etc), they 
 WG> should be processing it with the routines in ffind.c 
 WG> (FindOpen, FindNext). This in turn [current] translates 
 WG> the calls as best as it can to a case-insensitive glob 
 WG> expression, and uses the os-level glob() to do the 
 WG> wildcard. This should handle 99.99% of cases, 
 WG> particularly under Linux + glibc.
 
Sounds reasonable, but there is something happening where in the OS/2 (and
DOS, back when I ran that) where I thought I could pass some file names
with or without the file extension and Max (or Squish, etc.) would do the
proper thing for appending (or not) the file extension.  The Linux code is
appending the extention in some cases where it already exists.....  Maybe
my memory on what should be happening is wrong.  Some of these things are
either initial configuration tasks, stuff I burried in command scripts or
don't do very often....

 WG> If you're doing wildcarding from the shell (e.g. as 
 WG> parameters do some tool, like mecca), the SHELL will 
 WG> expand the wildcard into multiple arguments on argv, as 
 WG> long as it matches at least one file (otherwise, the 
 WG> glob expression is passed as the argument). If you use 
 WG> SINGLE QUOTES around your wildcard (or escape it with 
 WG> backslash), the shell will not expand the wildcard; and 
 WG> rather pass the expression raw.

Thanks.  I was needing to look up how to quote characters on the command
line under the shells I use.  I don't do that a lot in this
environment.....

 WG> Another (horrible) technique, depending on what you're 
 WG> doing, looks something like this:
 WG>  
 WG> for file in *.mec
 WG> do
 WG>   mecca $file
 WG> done



Thanks for the note......

Take care.....

Bob Jones, 1:343/41


--- Maximus/2 3.01
* Origin: Top Hat 2 BBS (1:343/41)
SEEN-BY: 633/267 270
@PATH: 343/41 10/345 106/1 2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.