Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ GetTempFileName()

static string System.IO.Path.GetTempFileName ( )
inlinestatic

Definition at line 966 of file Path.cs.

967 {
968 Span<char> initialBuffer = stackalloc char[260];
969 ValueStringBuilder builder = new ValueStringBuilder(initialBuffer);
970 GetTempPath(ref builder);
971 initialBuffer = stackalloc char[260];
972 ValueStringBuilder path = new ValueStringBuilder(initialBuffer);
973 uint tempFileNameW = Interop.Kernel32.GetTempFileNameW(ref builder.GetPinnableReference(), "tmp", 0u, ref path.GetPinnableReference());
974 builder.Dispose();
975 if (tempFileNameW == 0)
976 {
977 throw Win32Marshal.GetExceptionForLastWin32Error();
978 }
979 path.Length = path.RawChars.IndexOf('\0');
980 string result = PathHelper.Normalize(ref path);
981 path.Dispose();
982 return result;
983 }
static uint GetTempFileNameW(ref char lpPathName, string lpPrefixString, uint uUnique, ref char lpTempFileName)
static string GetTempPath()
Definition Path.cs:942

References System.Text.ValueStringBuilder.Dispose(), System.IO.Win32Marshal.GetExceptionForLastWin32Error(), System.Text.ValueStringBuilder.GetPinnableReference(), Interop.Kernel32.GetTempFileNameW(), System.IO.Path.GetTempPath(), System.IO.PathHelper.Normalize(), and System.Text.ValueStringBuilder.RawChars.