By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,787 Members | 2,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,787 IT Pros & Developers. It's quick & easy.

borland findfirst not sorting by file age

P: n/a
I have a program which manages various log files of multiple
extensions. The program needs to delete files based on an age paramter
and a file number limit paramter. So if files are older than say a week
they get deleted, and if my max file number limit is 1000 and I have
1200, I delete 200 files, starting with the oldest. Findfirst and
findnext work great for putting the files into a list when there is
only one file type. They will load them from oldest to youngest, thus
they are sorted and all I do is start deleting from the beginning of
the list. However when I have more than one file type in my directory
it doesn't load them by age. It first loads all of one type of file,
oldest to youngest, then all of the next type of file, oldest to
youngest and so on. So if I try to trim them down to be under my max
file limit I end up deleting all of the first type of file, even if
they are younger than some of the second type. Obviously I could make
my own list by looping through all the first and doing a sort, but this
seems to time consuming. Eventually this program will manage thousands
of files all at once and this routine runs in a loop about once a
second, so adding another loop to go through and sort 10,000+ files
will probably be too time consuming.

Does anyone know of an alternative to findfirst/findnext that will work
in borland win32 and sort files by age only and will work with
thousands of files?

Feb 21 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
bmshirey wrote:
[...]
Does anyone know of an alternative to findfirst/findnext that will work
in borland win32 and sort files by age only and will work with
thousands of files?


Your question is off-topic here. Please post it to a Borland or to
a Win32 programming newsgroup.

V
--
Please remove capital As from my address when replying by mail
Feb 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.