Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FillAttributeInfo() [1/2]

static int System.IO.FileSystem.FillAttributeInfo ( string path,
ref global::Interop::Kernel32::WIN32_FILE_ATTRIBUTE_DATA data,
bool returnErrorOnNotFound )
inlinestaticpackage

Definition at line 36 of file FileSystem.cs.

37 {
38 int num = 0;
41 {
42 if (!global::Interop.Kernel32.GetFileAttributesEx(path, global::Interop.Kernel32.GET_FILEEX_INFO_LEVELS.GetFileExInfoStandard, ref data))
43 {
45 if (!IsPathUnreachableError(num))
46 {
47 global::Interop.Kernel32.WIN32_FIND_DATA data2 = default(global::Interop.Kernel32.WIN32_FIND_DATA);
48 using Microsoft.Win32.SafeHandles.SafeFindHandle safeFindHandle = global::Interop.Kernel32.FindFirstFile(path, ref data2);
49 if (safeFindHandle.IsInvalid)
50 {
52 }
53 else
54 {
55 num = 0;
56 data.PopulateFrom(ref data2);
57 }
58 }
59 }
60 }
61 if (num != 0 && !returnErrorOnNotFound && ((uint)(num - 2) <= 1u || num == 21))
62 {
63 data.dwFileAttributes = -1;
64 return 0;
65 }
66 return num;
67 }
static bool IsPathUnreachableError(int errorCode)
Definition FileSystem.cs:69
static string TrimEndingDirectorySeparator(string path)
static System.IO.DisableMediaInsertionPrompt Create()

References System.IO.DisableMediaInsertionPrompt.Create(), System.Runtime.InteropServices.Marshal.GetLastWin32Error(), System.IO.FileSystem.IsPathUnreachableError(), and System.IO.PathInternal.TrimEndingDirectorySeparator().

Referenced by System.IO.FileSystem.DirectoryExists(), System.IO.FileSystem.FileExists(), System.IO.FileSystem.GetAttributes(), System.IO.FileSystem.GetCreationTime(), System.IO.FileSystem.GetLastAccessTime(), System.IO.FileSystem.GetLastWriteTime(), and System.IO.FileSystemInfo.RefreshCore().