Solved

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

Posted on 2015-02-02
10
109 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
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

 

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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

860 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