Re: listfiles, moving files
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 17226
interpreted = N
texte = (Sandra L. Pitner)>I'm trying to move all the files in one folder to another folder afterI >process them in a batch manner...>...>it moves every second file to the intended folder. I presume this is >because of some index mix-up that occurs from removing files from the >folder.Yes, exact one half of the files are moved in each run of [MoveFiles...]Dave MacLeay's copy/delete method did the same in my test.If you run it half times the number of files to move, you are through.You can use the following workaround which does no harm if you forgetit in your code when the problem finally gets fixed...--------------------[math show=f]counter=0[/math][ListFiles store/pending/] [math show=f]counter=counter+1[/math][/ListFiles] [Loop start=1&end=[math]counter/2[/math]] [ListFiles store/pending/] [math show=f]counter=counter+1[/math] [MoveFile path=store/pending/[FileName]&to=store/ready/[FileName]][/ListFiles] [/Loop]--------------------At the first run I count the files, divide the counter value by 2 andthat is the number of runs you need to move all files. This is notremarkable slower than a single run because WebCat simply seems to getthe wrong index - and in case the behavior normalizes some day therewould be some empty runs who do not really matter.Peter__________________________________________Peter Ostry - po@ostry.com - www.ostry.comOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29 A-1130 Vienna Austriafon ++43-1-8777454 fax ++43-1-8777454-21
Associated Messages, from the most recent to the oldest:
(Sandra L. Pitner)>I'm trying to move all the files in one folder to another folder afterI >process them in a batch manner...>...>it moves every second file to the intended folder. I presume this is >because of some index mix-up that occurs from removing files from the >folder.Yes, exact one half of the files are moved in each run of [MoveFiles...]Dave MacLeay's copy/delete method did the same in my test.If you run it half times the number of files to move, you are through.You can use the following workaround which does no harm if you forgetit in your code when the problem finally gets fixed...--------------------[math show=f]counter=0[/math][ListFiles store/pending/] [math show=f]counter=counter+1[/math][/ListFiles] [Loop start=1&end=
[math]counter/2[/math]] [ListFiles store/pending/] [math show=f]counter=counter+1[/math] [MoveFile path=store/pending/[FileName]&to=store/ready/[FileName]][/ListFiles] [/Loop]--------------------At the first run I count the files, divide the counter value by 2 andthat is the number of runs you need to move all files. This is notremarkable slower than a single run because WebCat simply seems to getthe wrong index - and in case the behavior normalizes some day therewould be some empty runs who do not really matter.Peter__________________________________________Peter Ostry - po@ostry.com - www.ostry.comOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29 A-1130 Vienna Austriafon ++43-1-8777454 fax ++43-1-8777454-21
Peter Ostry
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:
Trouble with formula.db (1997)
Search in 2 or more catalogs (1997)
Limiting user access to .tmpl files (1997)
wc 2 pro users - sites, quotes wanted (1997)
Still having problems with Authen (1997)
Formulas.db not working (2006)
Emailer setup (1997)
NewCart+Search with one click ? (1997)
Claris HomePage messes up the code (1997)
Remove from list server (1997)
RE: Upload (1998)
WC 2.0 frames feature (1997)
Problems getting parameters passed into email. (1997)
Summing fields (1997)
webcat 2.1 new cart fields - please explain more (1998)
page redirect in webDNA (1997)
[WebDNA] Hosting (2011)
[shownext] (1998)
WebCat2 - storing unformatted date data? (1997)
First postarg not taking in $Commands (1997)