Solved

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

Posted on 2015-02-02
10
112 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
Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
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). …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

623 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