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

◆ Move() [2/2]

static void System.IO.File.Move ( string sourceFileName,
string destFileName,
bool overwrite )
inlinestatic

Definition at line 586 of file File.cs.

587 {
588 if (sourceFileName == null)
589 {
590 throw new ArgumentNullException("sourceFileName", SR.ArgumentNull_FileName);
591 }
592 if (destFileName == null)
593 {
594 throw new ArgumentNullException("destFileName", SR.ArgumentNull_FileName);
595 }
596 if (sourceFileName.Length == 0)
597 {
598 throw new ArgumentException(SR.Argument_EmptyFileName, "sourceFileName");
599 }
600 if (destFileName.Length == 0)
601 {
602 throw new ArgumentException(SR.Argument_EmptyFileName, "destFileName");
603 }
604 string fullPath = Path.GetFullPath(sourceFileName);
605 string fullPath2 = Path.GetFullPath(destFileName);
606 if (!FileSystem.FileExists(fullPath))
607 {
608 throw new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, fullPath), fullPath);
609 }
610 FileSystem.MoveFile(fullPath, fullPath2, overwrite);
611 }

References System.SR.Argument_EmptyFileName, System.SR.ArgumentNull_FileName, System.IO.FileSystem.FileExists(), System.SR.Format(), System.IO.Path.GetFullPath(), System.SR.IO_FileNotFound_FileName, and System.IO.FileSystem.MoveFile().