• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

the fastest way to retrieve all directories on a drive?

Whould you tell me the FASTEST way to retrieve all directories on a drive.Is there any API function or something else that can help me? I use recursively call of Dir$ function but it takes 20s for ~13000 files and ~900 folders. Please help! (I've VB5.0 Enterprise Edition)
0
polygon
Asked:
polygon
  • 2
1 Solution
 
wolfcragCommented:
The solution is to use FindFirstFile and FindNextFile API functions. They can also be used to find directories, not only files. It's a little bit long to describe here, but a beautiful example is on the following web page:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=341

If for some reason this URL doesn;t work, go to:

http://www.planet-source-code.com/vb/default.htm

and search for directory. The article is entitled: "Drive, Folder & File Property Page Demo"
0
 
msimanCommented:
0
 
msimanCommented:
Dear wolfrag,
Your answer is excellent.Thanks.
If you know something else that can help me you may email me at:
billy@sliven.osf.acad.bg
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now