Solved

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

Posted on 2015-02-02
10
103 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
  • 5
  • 3
  • 2
10 Comments
 
LVL 19

Expert Comment

by:MerijnB
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:Allan_Fernandes
Comment Utility
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
Comment Utility
Isn't there a reason in the event (created / deleted / edited)? It's been a while since I used it.
0
Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

 

Author Comment

by:Allan_Fernandes
Comment Utility
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 25

Expert Comment

by:Sinisa Vuk
Comment Utility
there is advanced find file api function FindFirstFile
0
 

Author Comment

by:Allan_Fernandes
Comment Utility
I am currently using it but was wondering if there was ready-made list via the OS
0
 
LVL 25

Expert Comment

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

Author Comment

by:Allan_Fernandes
Comment Utility
Thanks that makes a large difference
0

Featured Post

Want to promote your upcoming event?

Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now