CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    Germany, Bayern
    Posts
    15

    Getting sorted list of files

    How can I retrieve a sorted list of files in a specific directory? I have to sort this list in different ways. I don't want to display a dialog box (like CFileDialog).
    This issue is especially for a large amount of files in this directory

    Who knows how to do this?

    Thanks in advance


  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: Getting sorted list of files

    ::FindFirstFile() and ::FindNextFile() can retrieve a list of files in long filename format, including a specific set if desired ("*.TXT", "AP_*.DEF", etc) - but sorting is up to you. I'm sure there are plenty of algorithms for sorting text.

    --
    Jason Teagle
    [email protected]

  3. #3
    Join Date
    May 1999
    Location
    Republic of Korea
    Posts
    74

    Re: Getting sorted list of files

    You can use qsort function for sorting.




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