ITfromZX81
Programmer
Hey there,
I have a weird issue.
I am writing a program that waits until a file exists in a folder before opening it in another external program.
This part works fine - it will check for FileExists and waits until the file is there.
However, the file is transferred to that folder via FTP. The problem is that the file appears in the folder before it is complete - it starts at 0 bytes and then slowly goes up(I tested this by transferring and watching the file progress by pressing F5 to refresh the folder in windows).
My program, though, sees the file and opens it immediately -it has no way of knowing that the file isn't complete yet - the result is that the external program opens a blank file. If I wait until the file is sent and then start my program it then works fine, but I'm trying to automate a process so that isn't a solution.
I'm stumped - other than setting an arbitrary wait time before trying to open the file I'm not really sure how to get around this. I'd rather not get into writing my own ftp server if I can help it.
If anyone has any suggestions I would appreciate it. I'm using a very plain vanilla ftp server.
Thanks,
I have a weird issue.
I am writing a program that waits until a file exists in a folder before opening it in another external program.
This part works fine - it will check for FileExists and waits until the file is there.
However, the file is transferred to that folder via FTP. The problem is that the file appears in the folder before it is complete - it starts at 0 bytes and then slowly goes up(I tested this by transferring and watching the file progress by pressing F5 to refresh the folder in windows).
My program, though, sees the file and opens it immediately -it has no way of knowing that the file isn't complete yet - the result is that the external program opens a blank file. If I wait until the file is sent and then start my program it then works fine, but I'm trying to automate a process so that isn't a solution.
I'm stumped - other than setting an arbitrary wait time before trying to open the file I'm not really sure how to get around this. I'd rather not get into writing my own ftp server if I can help it.
If anyone has any suggestions I would appreciate it. I'm using a very plain vanilla ftp server.
Thanks,