|
-
August 16th, 1999, 05:22 AM
#1
Long Filename
I've problem with the Dir() function.
I'm working under Windows NT 4 SP 3 and VB 6, and it seem's that Dim() doesn't support long filenames.
Is it a lack of luck ?
I tried to use a FileSystemObject object to support long filenames (i hope ...), but i don't know how to list, whit a filter, all the files of a folder ... How can i do that ?
PS : Sorry for mistakes in this message 
<KfR>
-
August 17th, 1999, 02:18 AM
#2
Re: Long Filename
AFAIK the FileSystemObject doesn't support filters. But, you could use the VB Like operator to produce a filter as in
Dim fs as Scripting.FileSystemObject
set fs = new Scripting.FileSystemObject
Dim f as Folder
set f = fs.GetFolder("c:\schrott")
Dim fl as File
for Each fl In f.Files
If ucase(fl.Name) Like "*.EXE" then
Debug.print fl.Name
End If
next fl
You could also use the API functions FindFirstFile and FindNextFile to scan all files in a directory.
-
August 18th, 1999, 07:33 AM
#3
Re: Long Filename
Thanks a lot for your answer !
I know now a new operator : like !! Very good ... =)
But does the FileSystemObject support long filenames ?
And is it wrong that Dir() doesn't support the m ?
<KfR>
-
August 18th, 1999, 08:00 AM
#4
Re: Long Filename
yes, the FileSystemObject does support long file names.
The same is true for the Dir function.
I have no idea, why it doesn't work in your installation.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|