diff options
author | Jon Purdy <evincarofautumn@gmail.com> | 2017-10-03 04:21:19 +0300 |
---|---|---|
committer | Jon Purdy <evincarofautumn@gmail.com> | 2017-10-24 20:37:29 +0300 |
commit | 85f4b5b16704262bda7eb745aa74d125afa5c4ea (patch) | |
tree | 4ed980bda5c5ad549ed128780b6c2883da1cb2ec /mcs | |
parent | 8ea394429cdbff969cb2c32756f85beb4ef8880a (diff) |
[coop-handles] System.IO.MonoIO.ReplaceFile
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/corlib/System.IO/MonoIO.cs | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/mcs/class/corlib/System.IO/MonoIO.cs b/mcs/class/corlib/System.IO/MonoIO.cs index 2a1b8f7e66a..665a4ee6c77 100644 --- a/mcs/class/corlib/System.IO/MonoIO.cs +++ b/mcs/class/corlib/System.IO/MonoIO.cs @@ -245,11 +245,26 @@ namespace System.IO } [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static bool ReplaceFile (string sourceFileName, - string destinationFileName, - string destinationBackupFileName, - bool ignoreMetadataErrors, - out MonoIOError error); + private unsafe extern static bool ReplaceFile (char* sourceFileName, + char* destinationFileName, + char* destinationBackupFileName, + bool ignoreMetadataErrors, + out MonoIOError error); + + public static bool ReplaceFile (string sourceFileName, + string destinationFileName, + string destinationBackupFileName, + bool ignoreMetadataErrors, + out MonoIOError error) + { + unsafe { + fixed (char* sourceFileNameChars = sourceFileName, + destinationFileNameChars = destinationFileName, + destinationBackupFileNameChars = destinationBackupFileName) { + return ReplaceFile (sourceFileNameChars, destinationFileNameChars, destinationBackupFileNameChars, ignoreMetadataErrors, out error); + } + } + } [MethodImplAttribute (MethodImplOptions.InternalCall)] private unsafe extern static FileAttributes GetFileAttributes (char* path, out MonoIOError error); |