file.exists

File.Exists on network == wrong?

In my code i do if (!File.Exists(getSomePath())) { MessageBox.Show("... existing" + " " + getSomePath()); this.Close(); } I can see getSomePath() is correct but when i open the app on the network it says it doesnt exist. When i copy the folder to my local drive it says it does exist. Whats going on? ...

File Exists in WPF

if (!File.Exists("SomeFile.exe")) { //Does not exists } I have SomeFile.exe in the same path as the exe but the result is Does not Exists. This does not happen in Windows Form, does something change? ...

Restrictions by file extension in server 2008?

Hi, I am having problems downloading files possibly due to the file extensions not matching the actual file. What is happening is the File.Exists check is returning false for these even though the named file does exist. Is anybody aware of anything in IIS or even IE which would cause this. I have seen this with .txt, .exe. and .avi f...

File.Exists() incorrectly returning false from ASP.NET - security issue related to Thread vs Process identity?

I have an ASP.NET app using Windows authentication, and I'm testing for the existence of a file on a remote server. I'm authenticating as MYDOMAIN\my.username - this works. The file is \MYSERVER\WebShare\example.txt. This file exists. I can open it from various hosts whilst logged in as MYDOMAIN\my.username. Under Windows Explorer, the...

File.Exists() returns false, but not in debug

I'm being completely confused here folks, My code throws an exception because File.Exists() returns false public override sealed TCargo ReadFile(string fileName) { if (!File.Exists(fileName)) { throw new ArgumentException("Provided file name does not exist", "fileName"); } Visual studio breaks at the throw stateme...

C# system.io.filenotfoundexception

I am creating an app for my work to track behavior management over the course of a school year. To do this, I obviously needed a database. I built the program so that it would, when opened, check to see if the database exists, and if it doesn't, it creates one, and inputs the schema. This works perfectly on my dev computer, but when I ...

File.Exists() and File Access Synchronization across processes

I have a couple applications running in separate processes that each write to a central xml doc on the harddrive. I am using a named mutex to synchronize access to the file - but get the following exception often: System.IO.IOException: The requested operation cannot be performed on a file with a user-mapped section open. I realized ...

How to check if a specific file exists in directory or any of its subdirectories

In C#, how do I check if a specific file exists in a directory or any of its subdirectories? System.IO.File.Exists only seems to accept a single parameter with no overloads to search subdirectories. I can do it with LINQ and System.IO.Directory.GetFiles using the SearchOption.AllDirectories overload, but that seems a bit heavy han...