Al Feiveson ([email protected]) wrote
> Hello - In Stata 7, I tried to use the "dir" command with various
> combinations of letters - can someone please explain these results?
>
> Does this also happen in Stata 8?
>
> . dir sat*
> 1.4k 8/03/99 8:40 satish.ado
> 4.1k 6/27/97 7:29 satish.dta
> 40.1k 8/20/01 15:21 satish1_aug01.dta
> ...
>
> . dir saf*
> 40.1k 8/21/01 11:41 satish2_aug01.dta
> 40.1k 8/24/01 11:48 satish4_aug01.dta
> 57.6k 8/24/01 9:23 satish6_aug01.dta
> ...
Nick Cox ([email protected]) then suggested that Al try this from a
DOS prompt, where Al experienced the same behavior. For what it is worth,
I am unable to reproduce this behavior on a Windows 2000 computer using
Stata 8.1.
Al replied that
> So my conclusion is 1) its a MS Windows problem with its "DOSPROMPT"
> emulator. 2) Stata is using the equivalent of the DOSPROMPT command when
> applying its "dir" command, when perhaps it should use some other method of
> getting a directory listing.
I do not know what code Windows is using from a DOS prompt to perform
wildcard matching on filenames. Stata, however, uses the Win32 SDK
C functions "FindFirstFile()" and "FindNextFile()" to loop across files
and directories. These functions are documented explicitly as being
for WIN32 applications. That is, they are for 32-bit Windows applications,
which would cover any Windows application written for anything from
Windows 95 to Windows XP on 32-bit Intel (and compatible) hardware. They
have nothing to do with DOS. I do not know what functions Microsoft
uses in their stock File--Open dialogs, but the functions they document
for Windows programmers to use are the ones we are using.
I can think of three possibilities given that we can not quickly find
an example to reproduce the problem here:
1) This problem can only be seen when some very particular path
structure or combination of file names exists. If we were to
exactly recreate Al's file and directory structure, we would
be able to reproduce the problem. We could then try to find
a workaround.
2) This problem is specific to Stata 7. We use the same Windows C
functions in Stata 7 and Stata 8, but we did rearrange some of
the code calling them. A quick comparison of the code does not
reveal any obvious errors or situations in which such a problem
could occur, however.
3) This is a problem specific to Al's computer and could be either
some sort of bug/error in a system DLL or a symptom of some
filesystem trouble or some other problem.
At first glance, the above are listed in order of most likely to
least likely. However, given that we have never had another report
of this and cannot reproduce it right now, the chance that it could
be #3 has increased.
Al should document as much information about the full path in which
these files exist and about the full list of files in the directory
in question and send it to [email protected].
--Alan
([email protected])
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/