?
Solved

FindFirst - Directory Sort Order

Posted on 2003-03-16
4
Medium Priority
?
363 Views
Last Modified: 2013-11-20
Hi,
How can I change the directory sorting order (in the file system). for example if the directory is order by name and I want it to be order by date. (I need it for the FindFirst Method that returns the files in that order).
everything should be done from the code.
please write me down a code example or the API function name.
thanks,
The Shark.
0
Comment
Question by:TheShark8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 400 total points
ID: 8146280
If you mean FindFirstFile/FindNextFile, it is impossible to define the order of files. You need to solve this problem in the data structure where you keep the files.
For example, if you keep file names in std::vector, you need to sort this vector after it is filled. To sort files by date keep file creation/last access time together with file name (this time is available in WIN32_FIND_DATA structure).
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question