test/Shared/FunctionalTests.Transitional/TestHelpers/IOHelpers.cs
/// <summary>
/// Safely determines whether the specified file exists.
/// </summary>
/// <param name="path"> The file to check. </param>
/// <returns> True if the caller has the required permissions and path contains the name of an existing file; otherwise, false. This method also returns false if path is null, an invalid path, or a zero-length string. If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returns false regardless of the existence of path. </returns>
Safely determines whether the specified file exists.
Safely determines whether the specified file exists .
[SecuritySafeCritical]
        [PermissionSet(SecurityAction.Assert, Unrestricted = true)]
        public static bool FileExists(string path)
        {
            return File.Exists(path);
        }
[ SecuritySafeCritical ] [ PermissionSet ( SecurityAction . Assert , Unrestricted = true ) ] public static bool FileExists ( string path ) { return File . Exists ( path ) ; }
Safely determines whether the specified file exists.
Safely determines whether the specified file exists .
// Calling File.Exists demands FileIOPermission (Read flag) for the specified path.
True if the caller has the required permissions and path contains the name of an existing file; otherwise, false. This method also returns false if path is null, an invalid path, or a zero-length string. If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returns false regardless of the existence of path.
True if the caller has the required permissions and path contains the name of an existing file ; otherwise false . This method also returns false if path is null an invalid path or a zero - length string . If the caller does not have sufficient permissions to read the specified file no exception is thrown and the method returns false regardless of the existence of path .
path
string
The file to check.
The file to check .