Optic,
All of the "wrong" files have long file names, which suggests to me that
their short file name might be something ~1, which would match the *1.TXT".
You can use "dir /x" under the Command Prompt to see the 8.3 file names.
Unfortunately I don't know of any workarounds other then checking the names
returned from Directory.GetFiles. Note this is not to suggest there are not
other ways of limiting the search to long names...
Hope this helps
Jay
"OpticTygre" <(E-Mail Removed)> wrote in message
news:JYWdneG6U8PUsx3cRVn-(E-Mail Removed)...
>I have a directory of 27 files. The files end in either 1.txt, 2.txt,
>3.txt, or 4.txt.
>
> If I say:
>
> For Each filename As String In
> Directory.GetFiles("C:\TSA\DOWNLOADS\TRX\PERFORMANCE_DATA\DOWNLOAD\",
> "*1.TXT")
> Debug.WriteLine(filename)
> Next
>
> It prints out the following:
>
> C:\TSA\DOWNLOADS\TRX\PERFORMANCE_DATA\DOWNLOAD\E310920041.txt
> C:\TSA\DOWNLOADS\TRX\PERFORMANCE_DATA\DOWNLOAD\E311020041.txt
> C:\TSA\DOWNLOADS\TRX\PERFORMANCE_DATA\DOWNLOAD\HEI173680920044.txt
> C:\TSA\DOWNLOADS\TRX\PERFORMANCE_DATA\DOWNLOAD\HEI173680920042.txt
> C:\TSA\DOWNLOADS\TRX\PERFORMANCE_DATA\DOWNLOAD\HEI173680920043.txt
> C:\TSA\DOWNLOADS\TRX\PERFORMANCE_DATA\DOWNLOAD\HEI173680720041.txt
> C:\TSA\DOWNLOADS\TRX\PERFORMANCE_DATA\DOWNLOAD\HEI173680920041.txt
> C:\TSA\DOWNLOADS\TRX\PERFORMANCE_DATA\DOWNLOAD\R70136020720041.txt
> C:\TSA\DOWNLOADS\TRX\PERFORMANCE_DATA\DOWNLOAD\R70309010820041.txt
> C:\TSA\DOWNLOADS\TRX\PERFORMANCE_DATA\DOWNLOAD\R70332090920041.txt
>
> Obviously, this is not correct. If my search string is "*2.TXT",
> "*3.TXT", or "*4.TXT" it prints out alright. Has anyone seen this
> behavior before in Directory.GetFiles?
>
> -Jason
>
|