public static bool Exists(string path) { var attr = Win32FileSystem.GetFileAttributesW(GetWin32LongPath(path)); return(attr != Win32FileSystem.INVALID_FILE_ATTRIBUTES && ((attr & Win32FileSystem.FILE_ATTRIBUTE_ARCHIVE) == Win32FileSystem.FILE_ATTRIBUTE_ARCHIVE)); //if (path.Length < MAX_PATH) //{ // return System.IO.File.Exists(path); //} //else //{ // var attr = Win32FileSystem.GetFileAttributesW(GetWin32LongPath(path)); // return (attr != Win32FileSystem.INVALID_FILE_ATTRIBUTES && ((attr & Win32FileSystem.FILE_ATTRIBUTE_ARCHIVE) == Win32FileSystem.FILE_ATTRIBUTE_ARCHIVE)); //} }
public static System.IO.FileAttributes GetAttributes(string path) { return((System.IO.FileAttributes)Win32FileSystem.GetFileAttributesW(GetWin32LongPath(path))); }
public static bool Exists(string path) { var attr = Win32FileSystem.GetFileAttributesW(GetWin32LongPath(path)); return(attr != Win32FileSystem.INVALID_FILE_ATTRIBUTES && ((attr & Win32FileSystem.FILE_ATTRIBUTE_DIRECTORY) == Win32FileSystem.FILE_ATTRIBUTE_DIRECTORY)); }