Re: Bug in VFP 7 SP1 to watch out for!!!! by Jeff
Jeff
Wed Oct 25 13:53:39 CDT 2006
Well you could make that arguement but then I would say that DIR and ERASE
should behave the same way given the same arguements.
If "DIR CO*." had returned a list of files that matched "DIR CO*.*" then I
never would have typed "ERASE DIR CO*."
As far as I know the rule is that "DIR CO*" (without the .) will return a
list of database files whose name begins with CO. Once you put the . for the
extension the DIR is supposed to return something like an OS Directory.
In any case, DIR and ERASE should work the same.
The following is from the 7.0 help file on DIR. There is nothing in the help
for ERASE that says it should work any differently.
Include FileSkeleton to display information about file types other than
tables. FileSkeleton is a file specification skeleton that supports
wildcards. For example, to list all program files in the current directory,
issue the following command:
DIR *.PRGIn Visual FoxPro, you can issue the following command to list all
files without extensions:
DIR *."Lew Schwartz" <lschwartz@sionline.com> wrote in message
news:OIDEhRG%23GHA.5092@TK2MSFTNGP04.phx.gbl...
> AFAIK, all versions of foxpro share this behavior which is also shared by
> xBase in general. Maybe the language originators felt that this behavior
> required less knowledge of the underlying operating system and would be
> appreciated by desktop users. The thing to keep in mind is that all xBase
> file functions obey the rules of xBase first and the os second. This
> includes the way they resolve paths and wildcards. You could develop a
> bunch of file routines based on win32.api or just stay mindful of the
> limitations. In any event, this isn't a bug, imo.
> -Lew
> "Jeff Grippe" <jgrippe@hilldun.com> wrote in message
> news:12jv5ij67ktuafc@news.supernews.com...
>> Am I the only one who didn't know this?
>>
>> I have some test code that creates text files that begin with the letters
>> CO and have no extension. So these files would be "CO*."
>>
>> When I do a directory for these files using
>>
>> DIR CO*.
>>
>> I get a list of the text files that I created.
>>
>> When I then type
>>
>> ERASE CO*.
>>
>> it does the same as if I had typed ERASE CO*.*
>>
>> I don't know if VFP 9 is similarly affected but this could be potentially
>> very bad. Of all commands in the world that should know the difference
>> between xxx*. and xxx*.* erase would be the most important.
>>
>> Also, VFP's erase does not put things in the recycle bin. In my case,
>> everything important was backed up so no real trouble was caused.
>>
>> This is, in my opinion, a very bad bug.
>>
>> Jeff
>>
>
>