-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
Description
public static void Copy(string sourcePath, string destinationPath, bool overwrite)
{
if (Common.IsRunningOnMono() && Common.IsPlatformUnix()) SysFile.Copy(sourcePath, destinationPath, overwrite);
string normalizedSourcePath = Path.NormalizeLongPath(sourcePath, "sourcePath");
string normalizedDestinationPath = Path.NormalizeLongPath(destinationPath, "destinationPath");
if (!NativeMethods.CopyFile(normalizedSourcePath, normalizedDestinationPath, !overwrite))
throw Common.GetExceptionFromLastWin32Error();
}
It should be "return" or smth after SysFile.Copy. For example:
public static void Copy(string sourcePath, string destinationPath, bool overwrite)
{
if (Common.IsNotWindows())
{
SysFile.Copy(sourcePath, destinationPath, overwrite);
**return;**
}
string normalizedSourcePath = Path.NormalizeLongPath(sourcePath, "sourcePath");
string normalizedDestinationPath = Path.NormalizeLongPath(destinationPath, "destinationPath");
if (!NativeMethods.CopyFile(normalizedSourcePath, normalizedDestinationPath, !overwrite))
throw Common.GetExceptionFromLastWin32Error();
}
Reactions are currently unavailable