Tuesday, August 18, 2009 at 7:35 PM.

photoFanSuite.background.everyNight

<<Changes
	<<2/2/08; 4:40:02 PM by DW
		<<Remove all image tables created more than a week ago whose files have been deleted.
			<<The "week ago" constraint makes it much faster and still achieves the desired effect of keeping the table from growing out of control.
bundle { //remove all image tables whose files have been deleted
	local (i, adr, ctdeleted=0, marktime = clock.now () - (60 * 60 * 24 * 7));
	for i = sizeof (user.photofan.images) downto 1 {
		adr = @user.photofan.images [i];
		if timecreated (adr) < marktime {
			if defined (adr^.f) {
				if not file.exists (adr^.f) {
					delete (adr);
					ctdeleted++}}
			else {
				delete (adr);
				ctdeleted++}}};
	if ctdeleted > 0 {
		filemenu.save ()}}
	<<dialog.alert (ctdeleted)



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.