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

◆ CopyFile()

static void System.IO.FileSystem.CopyFile ( string sourceFullPath,
string destFullPath,
bool overwrite )
inlinestatic

Definition at line 227 of file FileSystem.cs.

228 {
230 if (num == 0)
231 {
232 return;
233 }
234 string path = destFullPath;
235 if (num != 80)
236 {
237 using (SafeFileHandle safeFileHandle = Interop.Kernel32.CreateFile(sourceFullPath, int.MinValue, FileShare.Read, FileMode.Open, 0))
238 {
239 if (safeFileHandle.IsInvalid)
240 {
242 }
243 }
244 if (num == 5 && DirectoryExists(destFullPath))
245 {
246 throw new IOException(SR.Format(SR.Arg_FileIsDirectory_Name, destFullPath), 5);
247 }
248 }
249 throw Win32Marshal.GetExceptionForWin32Error(num, path);
250 }
static unsafe SafeFileHandle CreateFile(string lpFileName, int dwDesiredAccess, FileShare dwShareMode, SECURITY_ATTRIBUTES *lpSecurityAttributes, FileMode dwCreationDisposition, int dwFlagsAndAttributes, IntPtr hTemplateFile)
Definition Interop.cs:105
static int CopyFile(string src, string dst, bool failIfExists)
Definition Interop.cs:702
static bool DirectoryExists(string fullPath)
Definition FileSystem.cs:9

References System.SR.Arg_FileIsDirectory_Name, Interop.Kernel32.CopyFile(), Interop.Kernel32.CreateFile(), System.IO.FileSystem.DirectoryExists(), System.SR.Format(), and System.IO.Win32Marshal.GetExceptionForWin32Error().

Referenced by System.IO.File.Copy(), and System.IO.FileInfo.CopyTo().