public static FileAttributes GetAttributes(string path) { if (path == null) { throw new ArgumentNullException("path"); } if (path.Trim().Length == 0) { throw new ArgumentException(Locale.GetText("Path is empty")); } if (path.IndexOfAny(Path.InvalidPathChars) >= 0) { throw new ArgumentException(Locale.GetText("Path contains invalid chars")); } MonoIOError error; FileAttributes attrs; attrs = MonoIO.GetFileAttributes(path, out error); if (error != MonoIOError.ERROR_SUCCESS) { throw MonoIO.GetException(path, error); } return(attrs); }
public static bool ExistsDirectory(string path, out MonoIOError error) { FileAttributes fileAttributes = MonoIO.GetFileAttributes(path, out error); if (error == MonoIOError.ERROR_FILE_NOT_FOUND) { error = MonoIOError.ERROR_PATH_NOT_FOUND; } return(fileAttributes != MonoIO.InvalidFileAttributes && (fileAttributes & FileAttributes.Directory) != (FileAttributes)0); }
public static FileAttributes GetAttributes(string path) { Path.Validate(path); SecurityManager.EnsureElevatedPermissions(); // this is a no-op outside moonlight MonoIOError error; FileAttributes attrs; attrs = MonoIO.GetFileAttributes(path, out error); if (error != MonoIOError.ERROR_SUCCESS) { throw MonoIO.GetException(path, error); } return(attrs); }
public static bool ExistsSymlink(string path, out MonoIOError error) { FileAttributes fileAttributes = MonoIO.GetFileAttributes(path, out error); return(fileAttributes != MonoIO.InvalidFileAttributes && (fileAttributes & FileAttributes.ReparsePoint) != (FileAttributes)0); }
public static bool ExistsFile(string path, out MonoIOError error) { FileAttributes fileAttributes = MonoIO.GetFileAttributes(path, out error); return(fileAttributes != MonoIO.InvalidFileAttributes && (fileAttributes & FileAttributes.Directory) == (FileAttributes)0); }
public static bool Exists(string path, out MonoIOError error) { FileAttributes fileAttributes = MonoIO.GetFileAttributes(path, out error); return(fileAttributes != MonoIO.InvalidFileAttributes); }