Re: Any help gratefully appreciated
This WebDNA talk-list message is from 2001
It keeps the original formatting.
numero = 39798
interpreted = N
texte = on 10/31/01 9:56 am, Laeg Ent. at laeg_enterprises@yahoo.co.uk so noted...> --- dale
wrote: > It is not> safe to delete files within a listfiles.>> >> When you use listfiles it counts all the files, so>> if you have 10 files,>> then delete one, listfiles still thinks you have 10,>> which is why they do>> not delete as you think they should.> > Is it not ok in this case as the deleting is done> outside of the listfiles????The problem is that you're deleting records from your database within your[founditems] loop. You'd have to move the deletion outside.This should remove any entry in filelist.db that *doesn't* appear as a filein /orders:[math show=f]delTotal=0[/math][listfiles path=orders][showif [lookup db=orders/filelist.db&value=[filename]&lookInField=[filenames]&returnField=[filenames]¬Found=]=][math show=f]delTotal=[delTotal]+1[/math][text]delFile[delTotal]=[filename][/text][/showif][/listfiles][loop start=1&end=[delTotal]][deletedb=orders/filelist.db&eqFILENAMESdata=[text]delFile[index][/text]][/loop]A couple side notes:> [search> db=orders/filelist.db&neFILENAMESdatarq=find_all&rank=on]Parameters within WebCat commands shouldn't be quoted. Also, there's norank=on. Use rank=off to return results in the same order they appear in thedatabase.> [text]doDelete=[F][/text]If you're setting text variables to use as booleans, I'd recommend using Tand F instead of [T] and [F].> [If [filenames]=[filename]]> [then]> [text]doDelete=[T][/text]> [/then]> [else]> [/else]> [/If]If you're not needing it, the [else] is optional. And for simple does thisequal this comparisons, [showif] is your friend! : )> [delete> db=orders/filelist.db&eqFILENAMESdatarq=[filenames]]> [FlushDatabases]> [/founditems][FlushDatabases] is going to commit and close *all* databases open on yourserver. If you don't have Commit Databases set to automatic in your WebCatpreferences, you might want to just put a [commitdatabasedb=orders/filelist.db] in there instead (outside the [founditems]) to commitjust that one database yet still leave it open in RAM. Do a [closedatabasedb=orders/filelist.db] if you want the database removed from RAM as well.Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fhttp://www.toastdesign.com-------------------------------------------------------------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://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
on 10/31/01 9:56 am, Laeg Ent. at laeg_enterprises@yahoo.co.uk so noted...> --- dale wrote: > It is not> safe to delete files within a listfiles.>> >> When you use listfiles it counts all the files, so>> if you have 10 files,>> then delete one, listfiles still thinks you have 10,>> which is why they do>> not delete as you think they should.> > Is it not ok in this case as the deleting is done> outside of the listfiles????The problem is that you're deleting records from your database within your[founditems] loop. You'd have to move the deletion outside.This should remove any entry in filelist.db that *doesn't* appear as a filein /orders:[math show=f]delTotal=0[/math][listfiles path=orders][showif [lookup db=orders/filelist.db&value=[filename]&lookInField=[filenames]&returnField=[filenames]¬Found=]=][math show=f]delTotal=[delTotal]+1[/math][text]delFile[delTotal]=[filename][/text][/showif][/listfiles][loop start=1&end=[delTotal]][deletedb=orders/filelist.db&eqFILENAMESdata=[text]delFile[index][/text]][/loop]A couple side notes:> [search> db=orders/filelist.db&neFILENAMESdatarq=find_all&rank=on]Parameters within WebCat commands shouldn't be quoted. Also, there's norank=on. Use rank=off to return results in the same order they appear in thedatabase.> [text]doDelete=[F][/text]If you're setting text variables to use as booleans, I'd recommend using Tand F instead of [T] and [F].> [If [filenames]=[filename]]> [then]> [text]doDelete=[T][/text]> [/then]> [else]> [/else]> [/If]If you're not needing it, the [else] is optional. And for simple does thisequal this comparisons, [showif] is your friend! : )> [delete> db=orders/filelist.db&eqFILENAMESdatarq=[filenames]]> [flushdatabases]> [/founditems][flushdatabases] is going to commit and close *all* databases open on yourserver. If you don't have Commit Databases set to automatic in your WebCatpreferences, you might want to just put a [commitdatabasedb=orders/filelist.db] in there instead (outside the [founditems]) to commitjust that one database yet still leave it open in RAM. Do a [closedatabasedb=orders/filelist.db] if you want the database removed from RAM as well.Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fhttp://www.toastdesign.com-------------------------------------------------------------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://search.smithmicro.com/
Rob Marquardt
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:
Fulfillment e-mail? (1998)
Bit off subject -- Faxing orders (1997)
Rams SuperBowl Champs (2000)
Not really WebCat (1997)
Summing fields (1997)
Accounting System and WebCatalog/WebMerchant (2000)
Exclamation point (1997)
Re1000001: Setting up shop (1997)
Snippet for finding unused Header Fields in the Orders.db (2003)
Press Release hit the NewsWire!!! (1997)
Problems with shopping cart (1997)
Re:Emailer and encryption (1997)
[bump -SMSI] Sitebuilder (2004)
Nested search (1997)
[delete] problem (1997)
Searchable WebCat (etc.) Docs ? (1997)
why .HTML pages no processing? (2000)
Emailer [cart] file names (1997)
[OT] - Integration of Swish-e Search Engine (2004)
Erotic Sites (1997)