CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Long Filename

  1. #1
    Join Date
    May 1999
    Posts
    23

    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>

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    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.


  3. #3
    Guest

    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>


  4. #4
    Guest

    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
  •  





Click Here to Expand Forum to Full Width

Featured