From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM" 20-SEP-1993 17:49:07.40
To:	EVERHART
CC:	
Subj:	Re: Matching wildcard file specs

X-Newsgroups: comp.os.vms
Subject: Re: Matching wildcard file specs
Message-ID: <1993Sep20.163314.1@nl101.ittpub.nl>
From: ptdsc_hv@nl101.ittpub.nl (Hans van Veen - ITT Publitec)
Date: 20 Sep 93 16:33:14 WET+0100
Organization: ITT Publitec R+D BV, Amsterdam
Nntp-Posting-Host: nl103
Nntp-Posting-User: pmiss_ao
Lines: 61
To: Info-VAX@KL.SRI.COM
X-Gateway-Source-Info: USENET

In article <1993Sep16.150758.1632@mwk.com>, richardsro@mwk.com writes:
>   I am trying to write a routine to determine whether a given file spec matches 
> a wildcard file spec.  It's less trivial than it sounds.  STR$MATCH_WILD
> definitely comes in handy, but it only recognizes "*" and "%" as wildcard
> characters.  It does not handle the "..." wildcard for directories, which is
> the only thing I have yet to finish.
> 
>   While I'm sure I can eventually get it right, I also suspect that someone out
> there in netland may have already solved this problem and doesn't mind sharing
> their solution with me.  If you are that person, please feel free to e-mail me 
> or post your code.  It will be much appreciated.
> -- 
> Bobby Richards
> richardsro@mwk.com
-- 

You might consider using LIB$FIND_FILE


	program FIND_FILE

	integer*2	OF_Len
	integer*4	Sts, LIB$FIND_FILE, FF_Ctx
	character	Input_File*30 /'DISK$DIS:[PTDSC_HV...]MARK.*'/,
     +			Output_File*256

	Sts = LIB$FIND_FILE(Input_File, Output_File, FF_Ctx)
	do while (Sts)
	  call STR$TRIM(Output_File, Output_File, OF_Len)
	  type *, Output_File(1:OF_Len)
	  Sts = LIB$FIND_FILE(Input_File, Output_File, FF_Ctx)
	enddo
	Sts = LIB$FIND_FILE_END(FF_Ctx)
	end

HvV>fort find_file
HvV>link find_file
HvV>run find_file
DISK$DIS:[PTDSC_HV.SRC]MARK.DIR;1
DISK$DIS:[PTDSC_HV.SRC.MARK]MARK.CLD;1
DISK$DIS:[PTDSC_HV.SRC.MARK]MARK.EXE;1
DISK$DIS:[PTDSC_HV.SRC.MARK]MARK.FOR;1
DISK$DIS:[PTDSC_HV.SRC.MARK]MARK.HLB;1
DISK$DIS:[PTDSC_HV.SRC.MARK]MARK.HLP;1
DISK$DIS:[PTDSC_HV.SRC.MARK]MARK.INC;1
DISK$DIS:[PTDSC_HV.SRC.MARK]MARK.OLB;1
HvV>

It works.....

--->>>  Happiness is just an illusion filled with sadness and confusion.  <<<---

	Hans van Veen			Email: hansv@ittpub.nl
	ITT Publitec			       PSI%022846811423::VANVEEN
	Datacenter/SSS			Phone: +31 20 56 76 797
	Hoekenrode 1			Fax  : +31 20 69 10 374
	1102 BR  AMSTERDAM
	Netherlands

--->>>   It's not reality that's important, but how you perceive things   <<<---


