*Quickly* counting the number of files on a partition
Madison Kelly
linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Thu Jan 19 03:57:20 UTC 2006
Hi all,
I am trying to clean up part of the user interface on my backup
program but I need some advice.
In short;
Can I *quickly* get the number of files (and dirs, links, etc) on a
given partition or under a certain directory? The two keeps are
"quickly" and "partition"; it's can't traverse file systems /or/ be
limited to a directory (and it's sub directories).
The problem;
I store information on all the files on a given partition in a
database. Currently I have no way of knowing how many files will be
scanned when the job begins so I have to print "X number of files
scanned in Y seconds so far" every so often. Effective but not pretty.
What I would prefer;
If I could get the number of files (or even an approximate 'a-la
pgsql planner) on a given device I could create a traditional progress
bar but periodically checking how many files have been scanned and
updating the progress bar. 100% accuracy is not critical, but I would
like to stay within 90%. :p
The problem with the time it takes to get the number of files is that
this is strictly a cosmetic enhancement so I want to keep the
performance hit as small as possible.
Thanks!!
Madison
PS - This is a perl program but system calls are okay, too.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Madison Kelly (Digimer)
TLE-BU; The Linux Experience, Back Up
Main Project Page: http://tle-bu.org
Community Forum: http://forum.tle-bu.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list