Lets say for example I had a 20gb file and I decided to copy it to “c:/folder/filename.ext”. Obviously this would take some time to complete.
What would the the following return if it was executed whilst the copy was taking place?
File.Exists("c:/folder/filename.ext");
Assuming the process you are running your code under has sufficient privileges to read the file it will return
True(don’t forget thatFile.ExistsreturnsFalseif the account doesn’t have sufficient privileges to read the file even if the file exists). TheFile.Existsmethod doesn’t care if the file is currently being written to or read from: