Re: Any help gratefully appreciated

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 39799
interpreted = N
texte = I achieve the same result whether I use listfiles in the loop or use a temp.db, the problem is with the [search], it does not seem able to cope with the [Flushdatabase], so given a list1 2 3 4and its pointer being at 1 in the beginning, after flushdatabase it moves its pointer on one but the file looks like this now2 3 4instead of pointing at 2, it points at 3, the second value and thats why it keeps skipping values, any ideas how I would combat this? Thanks again. --- dale wrote: > Do something like: > > [listfiles orders] > [append db=temp.db]filename=[filename] > [/listfiles] > > Then do your searching, comparing and deleting based > on the information in > the temp database. Check the valid information that > can be returned from > [listfiles] to make sure you save/record what you > need. Yu can also store > the create date of the file in the database. > > But probably the more important question, what s the > purpose of this > checking? Maybe there is a better way to accomplish > your goal. > > Dale > > > on 10/31/2001 4:56 PM, Laeg Ent. at > laeg_enterprises@yahoo.co.uk wrote: > > > --- 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???? > > > >> You need to use a temporary database or otherwise > >> store the results of your > >> listfiles, then take action based on the temp > >> database. > >> > >> The files don't match as you have files named > with > >> .new and .old. You would > >> need to strip that out before doing your > comparison. > >> > >> Dale > >> > >> > >> on 10/31/2001 4:35 PM, Laeg Ent. at > >> laeg_enterprises@yahoo.co.uk wrote: > >> > >>> I have a folder called Orders > >>> I have a file in this folder calld filelist.db > >>> > >>> I list the filenames in Orders and list the > >> filenames > >>> in filelist.db, if they do not match, I delete > the > >>> filename in filelist.db. Its that simple. > However > >> this > >>> keeps happening > >>> > >>> Filenames in Orders= 1.old > >>> 2.old > >>> 3.old > >>> 4.old > >>> 5.old > >>> 6.old > >>> 7.old > >>> 8.old > >>> 9.old > >>> 10.old > >>> > >>> Filenames in Orders/filelist.db= > >>> 1.new > >>> 2.new > >>> 3.new > >>> 4.new > >>> 5.new > >>> 6.new > >>> 7.new > >>> 8.new > >>> 9.new > >>> 10.new > >>> > >>> Therefore no filenames are equal delete them all > >> so. > >>> When I run the code it only deletes every second > >> one > >>> so 1,3,5,7,9 will be deleted and not the others > >>> > >>> that leaves 2,4,6,8,10 > >>> > >>> if I run it again, it will again take the second > >> ones > >>> > >>> and delete 2,6,10 leaving 4,8 > >>> > >>> Why does it do this, this is the code: > >>> > >>> > >>> [text]doDelete=[F][/text] > >>> [search > >>> > >> > > > db=orders/filelist.db&neFILENAMESdatarq=find_all&rank=on] > >>> [founditems] > >>> [listfiles orders] > >>> [If [filenames]=[filename]] > >>> [then] > >>> [text]doDelete=[T][/text] > >>> [/then] > >>> [else] > >>> [/else] > >>> [/If] > >>> [/listfiles] > >>> [showif [doDelete]![T]] > >>> [delete > >>> > >> > db=orders/filelist.db&eqFILENAMESdatarq=[filenames]] > >>> [FlushDatabases] > >>> [/showif] > >>> [text]doDelete=[F][/text] > >>> [/founditems] > >>> [/search] > >>> Filelist database updated > >> > >> > >> > > > ------------------------------------------------------------- > >> 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/ > > > > > ____________________________________________________________ > > Nokia Game is on again. > > Go to http://uk.yahoo.com/nokiagame/ and join the > new > > all media adventure before November 3rd. > > > > > ------------------------------------------------------------- > > 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/ > > > > > ------------------------------------------------------------- > 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/ ____________________________________________________________ Nokia Game is on again. Go to http://uk.yahoo.com/nokiagame/ and join the new all media adventure before November 3rd.------------------------------------------------------------- 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:

    
  1. Re: Any help gratefully appreciated (Rob Marquardt 2001)
  2. Re: Any help gratefully appreciated (Laeg Ent. 2001)
  3. Re: Any help gratefully appreciated (Rob Marquardt 2001)
  4. Re: Any help gratefully appreciated (dale 2001)
  5. Re: Any help gratefully appreciated (Laeg Ent. 2001)
  6. Re: Any help gratefully appreciated (Laeg Ent. 2001)
  7. Re: Any help gratefully appreciated (dale 2001)
  8. Any help gratefully appreciated (Laeg Ent. 2001)
I achieve the same result whether I use listfiles in the loop or use a temp.db, the problem is with the [search], it does not seem able to cope with the [Flushdatabase], so given a list1 2 3 4and its pointer being at 1 in the beginning, after flushdatabase it moves its pointer on one but the file looks like this now2 3 4instead of pointing at 2, it points at 3, the second value and thats why it keeps skipping values, any ideas how I would combat this? Thanks again. --- dale wrote: > Do something like: > > [listfiles orders] > [append db=temp.db]filename=[filename] > [/listfiles] > > Then do your searching, comparing and deleting based > on the information in > the temp database. Check the valid information that > can be returned from > [listfiles] to make sure you save/record what you > need. Yu can also store > the create date of the file in the database. > > But probably the more important question, what s the > purpose of this > checking? Maybe there is a better way to accomplish > your goal. > > Dale > > > on 10/31/2001 4:56 PM, Laeg Ent. at > laeg_enterprises@yahoo.co.uk wrote: > > > --- 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???? > > > >> You need to use a temporary database or otherwise > >> store the results of your > >> listfiles, then take action based on the temp > >> database. > >> > >> The files don't match as you have files named > with > >> .new and .old. You would > >> need to strip that out before doing your > comparison. > >> > >> Dale > >> > >> > >> on 10/31/2001 4:35 PM, Laeg Ent. at > >> laeg_enterprises@yahoo.co.uk wrote: > >> > >>> I have a folder called Orders > >>> I have a file in this folder calld filelist.db > >>> > >>> I list the filenames in Orders and list the > >> filenames > >>> in filelist.db, if they do not match, I delete > the > >>> filename in filelist.db. Its that simple. > However > >> this > >>> keeps happening > >>> > >>> Filenames in Orders= 1.old > >>> 2.old > >>> 3.old > >>> 4.old > >>> 5.old > >>> 6.old > >>> 7.old > >>> 8.old > >>> 9.old > >>> 10.old > >>> > >>> Filenames in Orders/filelist.db= > >>> 1.new > >>> 2.new > >>> 3.new > >>> 4.new > >>> 5.new > >>> 6.new > >>> 7.new > >>> 8.new > >>> 9.new > >>> 10.new > >>> > >>> Therefore no filenames are equal delete them all > >> so. > >>> When I run the code it only deletes every second > >> one > >>> so 1,3,5,7,9 will be deleted and not the others > >>> > >>> that leaves 2,4,6,8,10 > >>> > >>> if I run it again, it will again take the second > >> ones > >>> > >>> and delete 2,6,10 leaving 4,8 > >>> > >>> Why does it do this, this is the code: > >>> > >>> > >>> [text]doDelete=[F][/text] > >>> [search > >>> > >> > > > db=orders/filelist.db&neFILENAMESdatarq=find_all&rank=on] > >>> [founditems] > >>> [listfiles orders] > >>> [If [filenames]=[filename]] > >>> [then] > >>> [text]doDelete=[T][/text] > >>> [/then] > >>> [else] > >>> [/else] > >>> [/If] > >>> [/listfiles] > >>> [showif [doDelete]![T]] > >>> [delete > >>> > >> > db=orders/filelist.db&eqFILENAMESdatarq=[filenames]] > >>> [flushdatabases] > >>> [/showif] > >>> [text]doDelete=[F][/text] > >>> [/founditems] > >>> [/search] > >>> Filelist database updated > >> > >> > >> > > > ------------------------------------------------------------- > >> 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/ > > > > > ____________________________________________________________ > > Nokia Game is on again. > > Go to http://uk.yahoo.com/nokiagame/ and join the > new > > all media adventure before November 3rd. > > > > > ------------------------------------------------------------- > > 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/ > > > > > ------------------------------------------------------------- > 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/ ____________________________________________________________ Nokia Game is on again. Go to http://uk.yahoo.com/nokiagame/ and join the new all media adventure before November 3rd.------------------------------------------------------------- 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/ Laeg Ent.

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:

WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) WebCat2: Items xx to xx shown, etc. (1997) Shopping carts and reloading pages (1997) [WriteFile] problems (1997) Emailer problems. (1998) Date problems-more (1997) [ShowNext] feature in 2.0 (1997) Multi Math bug? (2000) PCS Frames (1997) [ModDate] & [ModTime] ? (1997) Help with update to 2.11 (1998) Grant, please help me ... (1997) Re:Call For Entry: Third Annual Business on The Internet (BOTI) Awards (1999) Counting LineItems (2000) decrypt problem (2004) WebCat3.04/w*4/OS8.5.1 and aliases (1999) [OT] Display Glitch (2004) grep twice or a better way.... (2007) getting images' width/height (1998) Multiple catalog databases and showcart (1997)