Alaska Software Inc. - Problem with fexists/file function
Username: Password:
AuthorTopic: Problem with fexists/file function
Brian L. WolfsohnProblem with fexists/file function
on Mon, 04 Jan 2010 19:12:01 +0100
presume the existence of logs.exe. NOT logs>.exe

all of the below functions return .t.


? fexists("logs.exe")
? fexists("logs>.exe")

? file("logs.exe")
? file("logs>.exe")

It seems to be treating the > as a wildcard character similar to ? and *.  

bug ?? or is my mind leaking like a sieve again ??

Brian
Jack DuijfRe: Problem with fexists/file function
on Mon, 04 Jan 2010 23:43:19 +0100
Hello,

See article http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx
There you see that characters < > : " / \ | ? * are reserved characters for 
filenames.
I assume that Fexists() and File() pass your filename as parameter to a 
windows call, and the filename is processed there.

So i believe it's not a Xbase++ issue.

Regards,
Jack Duijf



"Brian L. Wolfsohn" <noblwnospam@cus.com> schreef in bericht 
news:Xns9CF686424D750blwcuscom@87.106.143.233...
> presume the existence of logs.exe. NOT logs>.exe
>
> all of the below functions return .t.
>
>
> ? fexists("logs.exe")
> ? fexists("logs>.exe")
>
> ? file("logs.exe")
> ? file("logs>.exe")
>
> It seems to be treating the > as a wildcard character similar to ? and *.
>
> bug ?? or is my mind leaking like a sieve again ??
>
> Brian
Joe Carrick Re: Problem with fexists/file function
on Mon, 04 Jan 2010 15:13:06 -0800
Hi Brian,

I assume you don't actually have a file named "logs>.exe"
Either Xbase++ or an underlying WinAPI function is probably stripping 
the ">" from the filename and returning the answer for "logs.exe".

Since I wouldn't expect Xbase++ to have been coded so carefully, it's 
most likely the WinAPI function.

hth, Joe

Brian L. Wolfsohn wrote:
> presume the existence of logs.exe. NOT logs>.exe
> 
> all of the below functions return .t.
> 
> 
> ? fexists("logs.exe")
> ? fexists("logs>.exe")
> 
> ? file("logs.exe")
> ? file("logs>.exe")
> 
> It seems to be treating the > as a wildcard character similar to ? and *.  
> 
> bug ?? or is my mind leaking like a sieve again ??
> 
> Brian
Joe Carrick Re: Problem with fexists/file function
on Mon, 04 Jan 2010 15:16:20 -0800
Note that none of the special characters are actually recognized except 
the :/\ characters which can be a part of a valid path.