Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2k views
in .NET FTP by
Hello,
My question is:
When im using the DownloadFile from local to remote I assume that other other programs cannot write at the same time to the same file (I mean 2 different processes that do the same thing), first am I right?

And second, what is really going on? It is locking the file when writing? And is it there a property maybe that can say if the remote file is locked and maybe a method that can lock the remote file form outside writing?

How i can sync between two Processes?

Thanks.

1 Answer

0 votes
by (162k points)
Writing to the same file may not be permissible by Windows, I'm not sure. However it is certainly not a good idea to do so.

When writing it is opening the file for writing - it is up to Windows to determine whether that locks the file.

Synching two processes requires some form of interprocess communication.

In FTP it is common to write to a file such as downloaded.tmp and then rename to downloaded.txt once the download is complete. That way a process waiting for the downloaded file won't see it (if it is looking for downloaded.txt) until it is downloaded completely and renamed.

Hello,
My question is:
When im using the DownloadFile from local to remote I assume that other other programs cannot write at the same time to the same file (I mean 2 different processes that do the same thing), first am I right?

And second, what is really going on? It is locking the file when writing? And is it there a property maybe that can say if the remote file is locked and maybe a method that can lock the remote file form outside writing?

How i can sync between two Processes?

Thanks.

Categories

...