FileInfo.Exists is not reliable along the UNC path

I want to determine if a UNC file exists. I create a FileInfo object and then call FileInfo.Exists. But it will sometimes return false, even if the file really exists.

How can I pinpoint if a UNC file exists?

+3
source share
1 answer

You cannot do this in a general sense, because, as Ben says, you may not have an ACL to find out if it exists. However, the best way to determine if a file exists (based on your script) is to try to open the file

+2
source

Source: https://habr.com/ru/post/1777598/


All Articles