WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Rename file when another file is present (Read 2161 times)
happyalbum
YaBB Newbies
*
Offline



Posts: 2
Rename file when another file is present
Jun 23rd, 2011 at 6:00pm
 
Every day we receive files in a folder named , say, order
I the folder arrive other folders, for each order one folder. These are called '000206xxxxxx' where xxxxx is a unique order number.
In each of these folders arive several kind of files, among which  000206xxxxxx-y.pdf', where y is a squence number. Also there is a file called order.xml. This file will be present at first, because its'created first and because the paf;s are about 350 MB each.
Only when all pdf's are present, order.xml has to renamed to dlready.xml. This because on another site watchftp is running and checks if dlready.xml is present and then starts a download of this folder.

Can I solve this with watchdirectory? Specially when you don't know how many pdf's arrive in each folder?
If not, will it maybe be possible by putting a extra file in each folder which name corresponds to the number of pdf's? The number of files is present inside the order.xml, but I don't think watchdirectory can read this info.

Thanks in advance

Jos
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Rename file when another file is present
Reply #1 - Jun 25th, 2011 at 6:16pm
 
Hello Jos, Hallo Jos,

Yes, that will be possible with a script. The way I see it the script will be triggered by WD when order.xml arrives.

The script will then do a "loop" to check for new/changed files arriving (and sleeping between checks). When nothing happens for a while, it does the rename.

I will be happy to write the script for you, but at the moment I am with friends in Denmark. Please contact me at my email (see my signature) on Tuesday.
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
happyalbum
YaBB Newbies
*
Offline



Posts: 2
Re: Rename file when another file is present
Reply #2 - Jun 25th, 2011 at 6:31pm
 
I certainly will, Gert. Thanks in advance and have fun in Denmark.
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1