wildcard with exists?

Scott Nelson scott at logicdatasystems.com
Tue Mar 22 08:05:42 PDT 2011


On 3/22/2011 9:54 AM, Richard Kreiss wrote:
>
>> -----Original Message-----
>> From: Scott Nelson [mailto:scott at logicdatasystems.com]
>> Sent: Monday, March 21, 2011 6:55 PM
>> To: rkreiss at gccconsulting.net
>> Cc: Filepro-list at lists.celestial.com
>> Subject: Re: wildcard with exists?
>>
>> On 3/21/2011 5:07 PM, Richard Kreiss wrote:
>>>> -----Original Message-----
>>>> From: filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com
>>>> [mailto:filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com]
>>>> On Behalf Of Scott Nelson
>>>> Sent: Monday, March 21, 2011 5:23 PM
>>>> To: Filepro-list at lists.celestial.com
>>>> Subject: wildcard with exists?
>>>>
>>>> I am looking for a way to test if a file exists, where that file will
>>> always begin
>>>> with a fixed first few characters, and the rest of the name be
>>>> varied.  I
>>> have
>>>> tried e=exists("/pathname/file*.txt") and it does not see the file.
>>>>
>>>> Is there a way with the exists command or is there a better way?
>>>>
>>>> Scott
>>> Scott,
>>>
>>> Are you sure that exists() is looking in the correct place for this
> file?
>>> You might try setting:
>>>
>>> 	fs=chr("47")
>>> 	qq=fs{"pathname"{fs{"file*.txt" {""
>>>
>>> Using the debugger see of the path resolves correctly.
>>>
>>> You could also do a system called using the path to see if you are
>>> actually looking in the correct place before
>>>
>>> 	E=exists(qq)
>>>
>> Thanks for the reply and idea.  I tried the code you supplied above, and
> it still
>> does not see the file using the * for part of the filename.
>>
>> BTW, I am on SCO OpenServer 6 with filePro 5.014
>>
>> Scott
> An * usually means a wild card or all matching.  Since exists() may be
> looking for a specific file name, it may not accept an asterisk as a single
> file name.
>
> Try replacing the * with a letter (fileA.txt) and then see if exists() finds
> that file.
>
> Richard
>
>

Replacing with the exact file name works.



More information about the Filepro-list mailing list