Re: Auto Delete EmailCompleted Files
This WebDNA talk-list message is from 2002
It keeps the original formatting.
numero = 45654
interpreted = N
texte = wierd, I confirmed this with my code.could this be considered a bug? seems illogical to me.just to note, I tested brian's code with one modification. I havecompleted emails dating back to august. I decided thatI would delete everything that is two months old or older.I changed 5 to 60. the result was that all my completedemails are gone (not a big deal as we have redundantbackups as well as they are not needed).Any ideas?at any rate, now I have a clean completed emails folder andsome new insight into the listfiles context. :-)cheers,DonovanBrian Fries wrote:[snip]The above script runs afoul of the dreaded delete while listing> conundrum, resulting in only every-other file being deleted.>> If you have 6 files, named a, b, c, d, e and f, then do a listfiles,> deleting each time through, you will delete file a on the first> pass, then file c on the second pass because c will now be the> second file in the list because a no longer exists. The third pass> will delete file e, leaving the three files b, d and f.>> My preferred way of dealing with this situation is to stick the names> of all the files to be deleted into a text variable, then, after the> [/listfiles], do a [listwords] on the file list to delete the listed> files.>> Also, a more portable way of accessing the EmailCompleted folder is> to go to the globals folder then back up a level.>> Here's my version - and I just tested it successfully on my server,> as I'd been meaning to do this anyway:>> [text]deletelist=[/text]> [text]completed=^../EmailCompleted/[/text]> [text]fivedaysago=[math]{[date]}-5[/math][/text]> [ListFiles path=[completed]]> [hideif [math]{[ModDate]}[/math]>[fivedaysago]]> [text]deletelist=[deletelist],[filename][/text]> [/hideif]> [/listfiles]> [listwords words=[url][deletelist][/url]&delimiters=,]> [DELETEFILE file=[completed][word]]> [/listwords]>> - brian> ---- ------------------------------------------------------------------------ ------------------------------------------------------------------------<><> Donovan Brooke <><>->ï ------------------------------------------------------------------------ -------------------------------------------------------------------------------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
wierd, I confirmed this with my code.could this be considered a bug? seems illogical to me.just to note, I tested brian's code with one modification. I havecompleted emails dating back to august. I decided thatI would delete everything that is two months old or older.I changed 5 to 60. the result was that all my completedemails are gone (not a big deal as we have redundantbackups as well as they are not needed).Any ideas?at any rate, now I have a clean completed emails folder andsome new insight into the listfiles context. :-)cheers,DonovanBrian Fries wrote:[snip]The above script runs afoul of the dreaded delete while listing> conundrum, resulting in only every-other file being deleted.>> If you have 6 files, named a, b, c, d, e and f, then do a listfiles,> deleting each time through, you will delete file a on the first> pass, then file c on the second pass because c will now be the> second file in the list because a no longer exists. The third pass> will delete file e, leaving the three files b, d and f.>> My preferred way of dealing with this situation is to stick the names> of all the files to be deleted into a text variable, then, after the> [/listfiles], do a [listwords] on the file list to delete the listed> files.>> Also, a more portable way of accessing the EmailCompleted folder is> to go to the globals folder then back up a level.>> Here's my version - and I just tested it successfully on my server,> as I'd been meaning to do this anyway:>> [text]deletelist=[/text]> [text]completed=^../EmailCompleted/[/text]> [text]fivedaysago=[math]{[date]}-5[/math][/text]> [ListFiles path=[completed]]> [hideif [math]{[ModDate]}[/math]>[fivedaysago]]> [text]deletelist=[deletelist],[filename][/text]> [/hideif]> [/listfiles]> [listwords words=[url][deletelist][/url]&delimiters=,]> [DELETEFILE file=[completed][word]]> [/listwords]>> - brian> ---- ------------------------------------------------------------------------ ------------------------------------------------------------------------<><> Donovan Brooke <><>->ï ------------------------------------------------------------------------ -------------------------------------------------------------------------------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Donovan
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
More on the email templates (1997)
[WebDNA] ONLY the FIRST continuous run of numeric chars? (2008)
Nested tags count question (1997)
can WC render sites out? (1997)
Summary search -- speed (1997)
WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)
WebDNA Solutions ... sorry! (1997)
Loops N Variables (1998)
More DateMath problems (1997)
Attn: Bug in GeneralStore example b15 (1997)
WebDNA deletes major DB data big time (2004)
Reminder... (2003)
SIMS & WebCat .... Alias Folder (2002)
RE: Error reading data -1 (1997)
Search/sort in URL Was: GuestBook example (1997)
$Append for Users outside the ADMIN group (1997)
Extra Text Fields (was Another question) (1997)
ShippingCosts (1998)
Talk List Suggestions (1997)
Searching an Email database (1997)