Question regarding a lock on a file
-
Hello, I think this is the first time i post a question on the codeproject, so hope it goes well:) So, the question is: How can i lock a file while it is being written so that other processes cannot move/delete or access it. I have a file that is being written into by an application on a remote machine and a windows service on the local machine that connects to the remote machine and downloads that file. The problem is that i want to download the file only after the write process has stopped completely. How can this be done? And a related question: How can this be done if i try to download the file from a ftp server. Both remote and local machine are under XP and the applications are written in c#. Thank you
-
Hello, I think this is the first time i post a question on the codeproject, so hope it goes well:) So, the question is: How can i lock a file while it is being written so that other processes cannot move/delete or access it. I have a file that is being written into by an application on a remote machine and a windows service on the local machine that connects to the remote machine and downloads that file. The problem is that i want to download the file only after the write process has stopped completely. How can this be done? And a related question: How can this be done if i try to download the file from a ftp server. Both remote and local machine are under XP and the applications are written in c#. Thank you
Pass FileShare.None to constructor of FileStream class.
Giorgi Dalakishvili #region signature my articles #endregion