示例#1
0
        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));
            //}
        }
示例#2
0
 public static System.IO.FileAttributes GetAttributes(string path)
 {
     return((System.IO.FileAttributes)Win32FileSystem.GetFileAttributesW(GetWin32LongPath(path)));
 }
示例#3
0
        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));
        }