Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Jun 21, 2018 2:39 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: File and folder deletion based on dates
PostPosted: Tue Apr 02, 2013 4:29 pm 
Offline

Joined: Thu Jan 24, 2013 5:10 pm
Posts: 14
I'm putting something together to delete files and folders based on modification and creation dates.

Any gotchas here?

This will run on Windows and Mac.

I was planning on giving the user the options of:
1) Not deleting folders.
2) Delete all folders
3) Deleting folders based on modification date.
4) Deleting folders based on creation date.
5) Deleting files based on modification date.
6) Deleting files based on creation date.

_________________
REAL Studio 2011 R1


Top
 Profile  
Reply with quote  
 Post subject: Re: File and folder deletion based on dates
PostPosted: Tue Apr 02, 2013 4:39 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
As you delete files in a folder, the folder's Count will be reduced, so you can't use a loop like

for i = 0 to folder.Count-1

If you try the trick of running the loop backwards, performance will be very bad.

So you should create an array of folderitems for the files you want to delete, and use the items in the array instead of the original folder when you go to delete them.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group