Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

Fast file count

Thread view: 
JavaEnquirer - 24 Mar 2006 17:53 GMT
I need to count the number of files and folders that exist under a
given root folder on aWindows. Easy to do with recursion and the
java.io.File class. A little slow however. Does anyone know of any open
source solutions ( maybe using native code )  or other cunning
suggestions to quickly obtain the information I need?
Roedy Green - 24 Mar 2006 19:31 GMT
On 24 Mar 2006 08:53:36 -0800, "JavaEnquirer"
<javaenquirer@hotmail.co.uk> wrote, quoted or indirectly quoted
someone who said :

>I need to count the number of files and folders that exist under a
>given root folder on aWindows. Easy to do with recursion and the
>java.io.File class. A little slow however. Does anyone know of any open
>source solutions ( maybe using native code )  or other cunning
>suggestions to quickly obtain the information I need?

Given that Windows itself takes considerable time to generate that
information when you open a directory in MyComputer, I suspect the
directories simply don't have that summary information available.

A strategy might be to scan the directories ahead of time and put up
with slightly out of date information as 4NT does.
see http://mindprod.com/jgloss/fornt.html

For another strategy, see http://mindprod.com/projects/filefinder.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.