diff --git a/xml/System.IO/File.xml b/xml/System.IO/File.xml index e3ffe0c8bd3..ca18a64fcd9 100644 --- a/xml/System.IO/File.xml +++ b/xml/System.IO/File.xml @@ -77,9 +77,9 @@ Many of the methods return other I/O types when you create or open files. You can use these other types to further manipulate a file. For more information, see specific members such as , , or . - Because all methods are static, it might be more efficient to use a method rather than a corresponding instance method if you want to perform only one action. All methods require the path to the file that you are manipulating. + Because all methods are static, if you want to perform only one action, it might be more efficient to use a method than a corresponding instance method. All methods require the path to the file that you are manipulating. - The static methods of the class perform security checks on all methods. If you are going to reuse an object several times, consider using the corresponding instance method of instead, because the security check will not always be necessary. + The static methods of the class perform security checks on all methods. If you are going to reuse an object several times, consider using the corresponding instance method of instead, because the security check won't always be necessary. By default, full read/write access to new files is granted to all users. @@ -97,17 +97,12 @@ In members that accept a path, the path can refer to a file or just a directory. The specified path can also refer to a relative path or a Universal Naming Convention (UNC) path for a server and share name. For example, all the following are acceptable paths: - `"c:\\\MyDir\\\MyFile.txt"` in C#, or `"c:\MyDir\MyFile.txt"` in Visual Basic. - - `"c:\\\MyDir"` in C#, or `"c:\MyDir"` in Visual Basic. - - `"MyDir\\\MySubdir"` in C#, or `"MyDir\MySubDir"` in Visual Basic. - - `"\\\\\\\MyServer\\\MyShare"` in C#, or `"\\\MyServer\MyShare"` in Visual Basic. For a list of common I/O tasks, see [Common I/O Tasks](/dotnet/standard/io/common-i-o-tasks). - - ## Examples The following example demonstrates how to use the class to check whether a file exists, and depending on the result, either create a new file and write to it, or open the existing file and read from it. Before running the code, create a `c:\temp` folder. @@ -5479,20 +5474,18 @@ The following example moves a file. The name of a file that replaces the file specified by . The name of the file being replaced. The name of the backup file. - Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file. + Replaces the contents of a specified file with the contents of another file, deleting the original file and creating a backup of the replaced file. method replaces the contents of a specified file with the contents of another file. It also creates a backup of the file that was replaced. - If the `sourceFileName` and `destinationFileName` are on different volumes, this method will raise an exception. If the `destinationBackupFileName` is on a different volume from the source file, the backup file will be deleted. - - Pass `null` to the `destinationBackupFileName` parameter if you do not want to create a backup of the file being replaced. - - If the `destinationBackupFileName` already exists it will be replaced with the contents of the `destinationFileName` file. + If the `sourceFileName` and `destinationFileName` are on different volumes, this method raises an exception. If the `destinationBackupFileName` is on a different volume from the source file, the backup file will be deleted. + Pass `null` to the `destinationBackupFileName` parameter if you don't want to create a backup of the file being replaced. + If the `destinationBackupFileName` already exists, it's replaced with the contents of the `destinationFileName` file. ## Examples The following code example uses the method to replace a file with another file and create a backup of the replaced file. @@ -5504,18 +5497,10 @@ The following example moves a file. ]]> - The path described by the parameter was not of a legal form. - - -or- - - The path described by the parameter was not of a legal form. + The path described by the or parameter is not of a legal form. The parameter is . An invalid drive was specified. - The file described by the current object could not be found. - - -or- - - The file described by the parameter could not be found. + The file described by or parameter could not be found. An I/O error occurred while opening the file. -or- @@ -5603,20 +5588,18 @@ The caller does not have the required permission. The name of the backup file. to ignore merge errors (such as attributes and access control lists (ACLs)) from the replaced file to the replacement file; otherwise, . - Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file and optionally ignores merge errors. + Replaces the contents of a specified file with the contents of another file, deleting the original file and creating a backup of the replaced file, and optionally ignores merge errors. method replaces the contents of a specified file with the contents of another file. It also creates a backup of the file that was replaced. - If the `sourceFileName` and `destinationFileName` are on different volumes, this method will raise an exception. If the `destinationBackupFileName` is on a different volume from the source file, the backup file will be deleted. - - Pass `null` to the `destinationBackupFileName` parameter if you do not want to create a backup of the file being replaced. - - If the `destinationBackupFileName` already exists it will be replaced with the contents of the `destinationFileName` file. + If the `sourceFileName` and `destinationFileName` are on different volumes, this method raises an exception. If the `destinationBackupFileName` is on a different volume from the source file, the backup file will be deleted. + Pass `null` to the `destinationBackupFileName` parameter if you don't want to create a backup of the file being replaced. + If the `destinationBackupFileName` already exists, it's replaced with the contents of the `destinationFileName` file. ## Examples The following code example uses the method to replace a file with another file and create a backup of the replaced file. @@ -5628,23 +5611,15 @@ The caller does not have the required permission. ]]> - The path described by the parameter was not of a legal form. - - -or- - - The path described by the parameter was not of a legal form. + The path described by the or parameter is not of a legal form. The parameter is . An invalid drive was specified. - The file described by the current object could not be found. - - -or- - - The file described by the parameter could not be found. + The file described by or parameter could not be found. An I/O error occurred while opening the file. -or- - The and parameters specify the same file. + and specify the same file. The specified path, file name, or both exceed the system-defined maximum length. The or parameter specifies a file that is read-only. @@ -5701,13 +5676,13 @@ The caller does not have the required permission. to follow links to the final target; to return the immediate next link. Gets the target of the specified file link. - A instance if exists, independently if the target exists or not. if is not a link. + A instance if exists, independently of whether the target exists or not. if is not a link. o A to the file or directory for which to set the creation date and time information. - A containing the value to set for the creation date and time of . - This value is expressed in UTC time. + The value to set for the creation date and time of . This value is expressed in UTC time. Sets the date and time, in Coordinated Universal Time (UTC), that the file or directory was created. To be added. @@ -6177,7 +6151,7 @@ It is not possible to change the compression status of a o The file for which to set the creation date and time information. - A containing the value to set for the creation date and time of . This value is expressed in UTC time. + The value to set for the creation date and time of . This value is expressed in UTC time. Sets the date and time, in Coordinated Universal Time (UTC), that the file was created. o The specified path, file name, or both exceed the system-defined maximum length. An I/O error occurred while performing the operation. - specifies a value outside the range of dates, times, or both permitted for this operation. + specifies a value outside the range of dates, times, or both permitted for this operation. The caller does not have the required permission. is in an invalid format. diff --git a/xml/System.IO/FileInfo.xml b/xml/System.IO/FileInfo.xml index df771135cf0..200048e4232 100644 --- a/xml/System.IO/FileInfo.xml +++ b/xml/System.IO/FileInfo.xml @@ -2173,7 +2173,7 @@ The following example demonstrates moving a file to a different location and ren 4.0.0.0 - Replaces the contents of a specified file with the file described by the current object, deleting the original file, and creating a backup of the replaced file. + Replaces the contents of a specified file with the file described by the current object, deleting the original file and creating a backup of the replaced file. The name of a file to replace with the current file. - The name of a file with which to create a backup of the file described by the parameter. - Replaces the contents of a specified file with the file described by the current object, deleting the original file, and creating a backup of the replaced file. - A object that encapsulates information about the file described by the parameter. + The name of a file with which to create a backup of the file described by the parameter. + Replaces the contents of a specified file with the file described by the current object, deleting the original file and creating a backup of the replaced file. + A object that encapsulates information about the file described by the parameter. method replaces the contents of a specified file with the contents of the file described by the current object. It also creates a backup of the file that was replaced. Finally, it returns a new object that describes the overwritten file. - Pass `null` to the `destBackupFileName` parameter if you do not want to create a backup of the file being replaced. - - + Pass `null` to the `destinationBackupFileName` parameter if you do not want to create a backup of the file being replaced. ## Examples The following example uses the method to replace a file with another file and create a backup of the replaced file. @@ -2266,12 +2264,12 @@ The following example demonstrates moving a file to a different location and ren ]]> - The path described by the parameter was not of a legal form. + The path described by the parameter was not of a legal form. -or- - The path described by the parameter was not of a legal form. - The parameter is . + The path described by the parameter was not of a legal form. + The parameter is . The file described by the current object could not be found. -or- @@ -2341,20 +2339,18 @@ The following example demonstrates moving a file to a different location and ren The name of a file to replace with the current file. - The name of a file with which to create a backup of the file described by the parameter. + The name of a file with which to create a backup of the file described by the parameter. to ignore merge errors (such as attributes and ACLs) from the replaced file to the replacement file; otherwise . Replaces the contents of a specified file with the file described by the current object, deleting the original file, and creating a backup of the replaced file. Also specifies whether to ignore merge errors. - A object that encapsulates information about the file described by the parameter. + A object that encapsulates information about the file described by the parameter. method replaces the contents of a specified file with the contents of the file described by the current object. It also creates a backup of the file that was replaced. Finally, it returns a new object that describes the overwritten file. - Pass `null` to the `destBackupFileName` parameter if you do not want to create a backup of the file being replaced. - - + Pass `null` to the `destinationBackupFileName` parameter if you do not want to create a backup of the file being replaced. ## Examples The following example uses the method to replace a file with another file and create a backup of the replaced file. @@ -2365,12 +2361,12 @@ The following example demonstrates moving a file to a different location and ren ]]> - The path described by the parameter was not of a legal form. + The path described by the parameter was not of a legal form. -or- - The path described by the parameter was not of a legal form. - The parameter is . + The path described by the parameter was not of a legal form. + The parameter is . The file described by the current object could not be found. -or-