Solved

How to get the contents within a Drive/Volume quickly via Delphi

Posted on 2015-02-02
10
110 Views
Last Modified: 2015-02-04
Using FindFirst I go thru all the files within a disk, this at times takes over an hour.
Does Windows maintain a updated stack of file names which I can pull.

I am aware of Dir /S and it takes similar time as using FindFirst,
0
Comment
Question by:Allan_Fernandes
[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
  • 5
  • 3
  • 2
10 Comments
 
LVL 19

Expert Comment

by:MerijnB
ID: 40585694
I'm quite sure there is no faster way then enumerating all files using FindFirst. You could try using multiple threads for different folders. What is the bigger picture? Maybe some optimizations can be done on another level.
0
 

Author Comment

by:Allan_Fernandes
ID: 40585701
I need it for my backup application. Considered using the File monitoring event (service) but that will reduce the speed of the machine even when backups are not happening.
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 40585706
I still think the file monitoring service is the way to go. If you only use it to note which files are changed while not actually doing a backup, it will only have a very small impact on the speed of the machine. In my opinion it's a much better approach then enumerating all files (which you will probably have to do anyways in the beginning).
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Allan_Fernandes
ID: 40585722
I tried it but the file names keep pouring into the event. eg: Opening windows explorer too causes several file names getting in. As I need new files / deleted files I cannot look only at the edited files. Also I need to compare within my list to avoid multiple lines per file.
0
 
LVL 19

Accepted Solution

by:
MerijnB earned 500 total points
ID: 40585728
Isn't there a reason in the event (created / deleted / edited)? It's been a while since I used it.
0
 

Author Comment

by:Allan_Fernandes
ID: 40585782
Yes there is but I need them all three and windows makes several temp files, which come in too.
But thinking again I may be able to discard some temp folders  etc and make it more efficient.
0
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 40586401
there is advanced find file api function FindFirstFile
0
 

Author Comment

by:Allan_Fernandes
ID: 40587959
I am currently using it but was wondering if there was ready-made list via the OS
0
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 40588355
Think that FindFirstFile will look into this "list" - if you have files indexed.
0
 

Author Comment

by:Allan_Fernandes
ID: 40588434
Thanks that makes a large difference
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
An article on effective troubleshooting
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

740 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