Solved

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

Posted on 2015-02-02
10
104 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
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
 

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
Why are Office 365 signatures so complicated?

Trying to setup transport rules for Office 365 email signatures and can’t quite figure it out? Having to test the signature over and over? Make things simple by using Exclaimer Cloud - Signatures for Office 365.

 

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 26

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 26

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

Being driven mad by email signature updates?

Having to make a change to your users’ email signatures, yet again? Feel like your head is going to explode? Rely on an Exclaimer email signature management solution to make the process simple!

Question has a verified solution.

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

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

863 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

26 Experts available now in Live!

Get 1:1 Help Now