Skip to content

Commit e5639a8

Browse files
Remove reference to nonexistent method in C# API (#3631)
* Remove reference to nonexistent method in C# API The mentioned method overload of File.Move() doesn't actually exist in the C# version of this API. I have removed the reference to it and briefly described an alternative option. * Explain difference in .NET Core 3 and .NET Framework Co-Authored-By: Carlos Sanchez Lopez <[email protected]>
1 parent eded66b commit e5639a8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

xml/System.IO/File.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2422,7 +2422,11 @@
24222422
24232423
This method works across disk volumes, and it does not throw an exception if the source and destination are the same.
24242424
2425-
Note that if you attempt to replace a file by moving a file of the same name into that directory, an <xref:System.IO.IOException> is thrown. For that purpose, call <xref:System.IO.File.Move(System.String,System.String,System.Boolean)> instead.
2425+
Note that if you attempt to replace a file by moving a file of the same name into that directory, an <xref:System.IO.IOException> is thrown. To avoid this problem:
2426+
2427+
- In .NET Core 3.0 and later versions, you can call <xref:System.IO.File.Move(System.String,System.String,System.Boolean)> setting the parameter `overwrite` to `true`, which will replace the file if it exists.
2428+
2429+
- In all .NET versions, you can call <xref:System.IO.File.Delete(System.String)> before calling `Move`, which will only delete the file if it exists.
24262430
24272431
The `sourceFileName` and `destFileName` arguments can include relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see <xref:System.IO.Directory.GetCurrentDirectory%2A>.
24282432

0 commit comments

Comments
 (0)