How to know if a file is opened for writing by another application
-
Hi, Here is the issue: - I am uploading a big file into a server using ftp - on the server, a process will start processing the file as soon as it detect is presence ( even incomplete file ) is there any why that this process can guess whether the file is finished uploading or not? thanks in advance.
-
Hi, Here is the issue: - I am uploading a big file into a server using ftp - on the server, a process will start processing the file as soon as it detect is presence ( even incomplete file ) is there any why that this process can guess whether the file is finished uploading or not? thanks in advance.
What I'm suggesting isn't very sophisticated but... you can make an empty second file with the same name and some identifying string after you've finished uploading the big file and make the server process look for it. So if your big file is named bigfile.dat, then then your process should look for a file named "bigfile.dat.isreadyforprocessing", then you remove the last part of the name, delete this empty file and you have the name of the file you should be processing.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
-
Hi, Here is the issue: - I am uploading a big file into a server using ftp - on the server, a process will start processing the file as soon as it detect is presence ( even incomplete file ) is there any why that this process can guess whether the file is finished uploading or not? thanks in advance.
-
Hi, Here is the issue: - I am uploading a big file into a server using ftp - on the server, a process will start processing the file as soon as it detect is presence ( even incomplete file ) is there any why that this process can guess whether the file is finished uploading or not? thanks in advance.
This also may be simple, but couldn't you just try to open the file? If the ftp server is still adding data into it, your exclusive-share-read open will fail? Just try later! Or add the .readyforprocessing file thingy - it's cunning as well as simple! Iain