Is DirectoryInfo.LastWriteTime a safe way to check that a file isn't still uploading?

Not at all. LastWriteTime is updated after writing, not while writing. You need to rely on whatever program is doing the uploading to put a lock on the file.

Any decent one does. So that trying to open the file with, say, the FileStream constructor with FileShare. Read or FileShare.

None will throw an IOException. This will almost always work.

I'm not entirely sure how accurate your method would be. However, an alternative solution would be to attempt to open the file in exclusive mode (FileShare. None) within a try-catch, e.g.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions