PDA

View Full Version : Waiting for files to copy




thriftinkid
Apr 8, 2008, 02:26 PM
Hey guys, I'm new to writing script. I have a script that moves files from one location to another so they can be uploaded to an ftp server. The problem is that the script tries to move on before they files are copied over. I need to write a script that check folder b every 10-15 sec to see if there is any change in the folder (file size growing because content are being copied into it). If there is no change within that time, then it is free to move on to the next step. Again I'm new to programming code in general. I have been using applescript. ANy Ideas?



ChrisA
Apr 8, 2008, 04:22 PM
I need to write a script that check folder b every 10-15 sec to see if there is any change in the folder (file size growing because content are being copied into it). If there is no change within that time, then it is free to move on to the next step. Again I'm new to programming code in general. I have been using applescript. ANy Ideas?

It is MUCH better to check the file to see if another process has the file open for write then to just wait until it stops getting bigger

thriftinkid
Apr 8, 2008, 04:40 PM
It is MUCH better to check the file to see if another process has the file open for write then to just wait until it stops getting bigger

the only issue with that is there is no file I am opening. I am moving a group of files into the folder to be uploaded to a server. And the files name are constant.

thriftinkid
Apr 8, 2008, 04:52 PM
the only issue with that is there is no file I am opening. I am moving a group of files into the folder to be uploaded to a server. And the files name are constant.

I'm sorry, the file names are not consistant.