TestableIO.System.IO.Abstractions
Wrapper around a which is used as a replacement
for a . As such it implements the same
properties and methods as a .
When overridden in a derived class, gets a value indicating whether the current stream supports reading. if the stream supports reading; otherwise, .
When overridden in a derived class, gets a value indicating whether the current stream supports seeking. if the stream supports seeking; otherwise, .
Gets a value that determines whether the current stream can time out.A value that determines whether the current stream can time out.
When overridden in a derived class, gets a value indicating whether the current stream supports writing. if the stream supports writing; otherwise, .
Gets a value that indicates whether the was opened asynchronously or synchronously. if the was opened asynchronously; otherwise, .
When overridden in a derived class, gets the length in bytes of the stream.A class derived from does not support seeking and the length is unknown.Methods were called after the stream was closed.A long value representing the length of the stream in bytes.
Gets the absolute path of the file opened in the .A string that is the absolute path of the file.
When overridden in a derived class, gets or sets the position within the current stream.An I/O error occurs.The stream does not support seeking.Methods were called after the stream was closed.The current position within the stream.
Gets or sets a value, in milliseconds, that determines how long the stream will attempt to read before timing out.The method always throws an .A value, in milliseconds, that determines how long the stream will attempt to read before timing out.
Gets or sets a value, in milliseconds, that determines how long the stream will attempt to write before timing out.The method always throws an .A value, in milliseconds, that determines how long the stream will attempt to write before timing out.
Initializes a new instance of .
The wrapped .
The of the stream.
The flag, indicating if the was
opened asynchronously or synchronously.
Begins an asynchronous read operation. (Consider using instead.)The buffer to read the data into.The byte offset in at which to begin writing data read from the stream.The maximum number of bytes to read.An optional asynchronous callback, to be called when the read is complete.A user-provided object that distinguishes this particular asynchronous read request from other requests.Attempted an asynchronous read past the end of the stream, or a disk error occurs.One or more of the arguments is invalid.Methods were called after the stream was closed.The current implementation does not support the read operation.An that represents the asynchronous read, which could still be pending.
Begins an asynchronous write operation. (Consider using instead.)The buffer to write data from.The byte offset in from which to begin writing.The maximum number of bytes to write.An optional asynchronous callback, to be called when the write is complete.A user-provided object that distinguishes this particular asynchronous write request from other requests.Attempted an asynchronous write past the end of the stream, or a disk error occurs.One or more of the arguments is invalid.Methods were called after the stream was closed.The current implementation does not support the write operation.An that represents the asynchronous write, which could still be pending.
Reads the bytes from the current stream and writes them to another stream, using a specified buffer size. Both streams positions are advanced by the number of bytes copied.The stream to which the contents of the current stream will be copied.The size of the buffer. This value must be greater than zero. The default size is 81920. is . is negative or zero.The current stream does not support reading.
-or-
does not support writing.Either the current stream or were closed before the method was called.An I/O error occurred.
Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token. Both streams positions are advanced by the number of bytes copied.The stream to which the contents of the current stream will be copied.The size, in bytes, of the buffer. This value must be greater than zero. The default size is 81920.The token to monitor for cancellation requests. The default value is . is . is negative or zero.Either the current stream or the destination stream is disposed.The current stream does not support reading, or the destination stream does not support writing.A task that represents the asynchronous copy operation.
Waits for the pending asynchronous read to complete. (Consider using instead.)The reference to the pending asynchronous request to finish. is .A handle to the pending read operation is not available.
-or-
The pending operation does not support reading. did not originate from a method on the current stream.The stream is closed or an internal error has occurred.The number of bytes read from the stream, between zero (0) and the number of bytes requested. ReadAsync returns zero (0) only if zero bytes were requested or if no more bytes will be available because it's at the end of the stream; otherwise, read operations do not complete until at least one byte is available. If zero bytes are requested, read operations may complete immediately or may not complete until at least one byte is available (but without consuming any data).
Ends an asynchronous write operation. (Consider using instead.)A reference to the outstanding asynchronous I/O request. is .A handle to the pending write operation is not available.
-or-
The pending operation does not support writing. did not originate from a method on the current stream.The stream is closed or an internal error has occurred.
When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.An I/O error occurs.
Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.The token to monitor for cancellation requests. The default value is .The stream has been disposed.A task that represents the asynchronous flush operation.
When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.An array of bytes. When this method returns, the buffer contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source.The zero-based byte offset in at which to begin storing the data read from the current stream.The maximum number of bytes to be read from the current stream.The sum of and is larger than the buffer length. is . or is negative.An I/O error occurs.The stream does not support reading.Methods were called after the stream was closed.The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if is 0 or the end of the stream has been reached.
When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.A region of memory. When this method returns, the contents of this region are replaced by the bytes read from the current source.The total number of bytes read into the buffer. This can be less than the size of the buffer if that many bytes are not currently available, or zero (0) if the buffer's length is zero or the end of the stream has been reached.
Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.The buffer to write the data into.The byte offset in at which to begin writing data from the stream.The maximum number of bytes to read.The token to monitor for cancellation requests. The default value is . is . or is negative.The sum of and is larger than the buffer length.The stream does not support reading.The stream has been disposed.The stream is currently in use by a previous read operation.A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if is 0 or if the end of the stream has been reached.
Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.The region of memory to write the data into.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous read operation. The value of its property contains the total number of bytes read into the buffer. The result value can be less than the length of the buffer if that many bytes are not currently available, or it can be 0 (zero) if the length of the buffer is 0 or if the end of the stream has been reached.
Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.The stream does not support reading.Methods were called after the stream was closed.The unsigned byte cast to an , or -1 if at the end of the stream.
When overridden in a derived class, sets the position within the current stream.A byte offset relative to the parameter.A value of type indicating the reference point used to obtain the new position.An I/O error occurs.The stream does not support seeking, such as if the stream is constructed from a pipe or console output.Methods were called after the stream was closed.The new position within the current stream.
When overridden in a derived class, sets the length of the current stream.The desired length of the current stream in bytes.An I/O error occurs.The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output.Methods were called after the stream was closed.
Returns a string that represents the current object.A string that represents the current object.
When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.An array of bytes. This method copies bytes from to the current stream.The zero-based byte offset in at which to begin copying bytes to the current stream.The number of bytes to be written to the current stream.The sum of and is greater than the buffer length. is . or is negative.An I/O error occurred, such as the specified file cannot be found.The stream does not support writing. was called after the stream was closed.
When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.A region of memory. This method copies the contents of this region to the current stream.
Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.The buffer to write data from.The zero-based byte offset in from which to begin copying bytes to the stream.The maximum number of bytes to write.The token to monitor for cancellation requests. The default value is . is . or is negative.The sum of and is larger than the buffer length.The stream does not support writing.The stream has been disposed.The stream is currently in use by a previous write operation.A task that represents the asynchronous write operation.
Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.The region of memory to write data from.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous write operation.
Writes a byte to the current position in the stream and advances the position within the stream by one byte.The byte to write to the stream.An I/O error occurs.The stream does not support writing, or the stream is already closed.Methods were called after the stream was closed.
Releases the unmanaged resources used by the and optionally releases the managed resources. to release both managed and unmanaged resources; to release only unmanaged resources.
Allows to cast the internal Stream to a FileStream
The FileSystemStream to cast
Abstractions for .
Creates all directories and subdirectories in the specified path unless they already exist.The directory to create.The directory specified by is a file.
-or-
The network name is not known.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method.
-or-
is prefixed with, or contains, only a colon character (:). is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive). contains a colon character (:) that is not part of a drive label ("C:\").An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
Creates all directories and subdirectories in the specified path with the specified permissions unless they already exist.The directory to create.A bitwise combination of the enumeration values that specifies the Unix file mode used to create directories. is a zero-length string, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The file mode is invalid.The caller does not have the required permission.The specified path exceeds the system-defined maximum length. is a file.A component of the is not a directory.An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
Creates a directory symbolic link identified by that points to .The path where the symbolic link should be created.The target directory of the symbolic link. or is . or is empty.
-or-
or contains invalid path characters.A file or directory already exists in the location of .
-or-
An I/O error occurred.A instance that wraps the newly created directory symbolic link.
Creates a uniquely named, empty directory in the current user's temporary directory.An optional string to add to the beginning of the subdirectory name. contains a directory separator.A new directory cannot be created.An object that represents the directory that was created.
Deletes an empty directory from a specified path.The name of the empty directory to remove. This directory must be writable and empty.A file with the same name and location specified by exists.
-or-
The directory is the application's current working directory.
-or-
The directory specified by is not empty.
-or-
The directory is read-only or contains a read-only file.
-or-
The directory is being used by another process.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length. does not exist or could not be found.
-or-
The specified path is invalid (for example, it is on an unmapped drive).
Deletes the specified directory and, if indicated, any subdirectories and files in the directory.The name of the directory to remove. to remove directories, subdirectories, and files in ; otherwise, .A file with the same name and location specified by exists.
-or-
The directory specified by is read-only, or is and is not an empty directory.
-or-
The directory is the application's current working directory.
-or-
The directory contains a read-only file.
-or-
The directory is being used by another process.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length. does not exist or could not be found.
-or-
The specified path is invalid (for example, it is on an unmapped drive).
Returns an enumerable collection of directory full names in a specified path.The relative or absolute path to the directory to search. This string is not case-sensitive..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. is . is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An enumerable collection of the full names (including paths) for the directories in the directory specified by .
Returns an enumerable collection of directory full names that match a search pattern in a specified path.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of directories in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters with the method.
-or-
does not contain a valid pattern. is .
-or-
is . is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified search pattern.
Returns an enumerable collection of directory full names that match a search pattern in a specified path, and optionally searches subdirectories.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of directories in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories. The default value is ..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method.
-or-
does not contain a valid pattern. is .
-or-
is . is not a valid value. is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified search pattern and search option.
Returns an enumerable collection of the directory full names that match a search pattern in a specified path, and optionally searches subdirectories.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of directories in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method.
-or-
does not contain a valid pattern. or is . is not a valid value. is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified search pattern and enumeration options.
Returns an enumerable collection of full file names in a specified path.The relative or absolute path to the directory to search. This string is not case-sensitive..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. is . is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An enumerable collection of the full names (including paths) for the files in the directory specified by .
Returns an enumerable collection of full file names that match a search pattern in a specified path.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of files in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method.
-or-
does not contain a valid pattern. is .
-or-
is . is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An enumerable collection of the full names (including paths) for the files in the directory specified by and that match the specified search pattern.
Returns an enumerable collection of full file names that match a search pattern in a specified path, and optionally searches subdirectories.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of files in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories. The default value is ..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method.
-or-
does not contain a valid pattern. is .
-or-
is . is not a valid value. is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An enumerable collection of the full names (including paths) for the files in the directory specified by and that match the specified search pattern and search option.
Returns an enumerable collection of full file names that match a search pattern and enumeration options in a specified path, and optionally searches subdirectories.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of files in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method.
-or-
does not contain a valid pattern. is .
-or-
is . is not a valid value. is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.An enumerable collection of the full names (including paths) for the files in the directory specified by and that match the specified search pattern and enumeration options.
Returns an enumerable collection of file names and directory names in a specified path.The relative or absolute path to the directory to search. This string is not case-sensitive..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. is . is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An enumerable collection of file-system entries in the directory specified by .
Returns an enumerable collection of file names and directory names that match a search pattern in a specified path.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of file-system entries in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method.
-or-
does not contain a valid pattern. is .
-or-
is . is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An enumerable collection of file-system entries in the directory specified by and that match the specified search pattern.
Returns an enumerable collection of file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against file-system entries in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories. The default value is ..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method.
-or-
does not contain a valid pattern. is .
-or-
is . is not a valid value. is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An enumerable collection of file-system entries in the directory specified by and that match the specified search pattern and option.
Returns an enumerable collection of file names and directory names that match a search pattern and enumeration options in a specified path.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of subdirectories in . This parameter can contain a combination of valid literal and wildcard characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method.
-or-
does not contain a valid pattern. is .
-or-
is . is not a valid value. is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An enumerable collection of file-system entries in the directory specified by , that match the specified search pattern and the specified enumeration options.
Determines whether the given path refers to an existing directory on disk.The path to test. if refers to an existing directory; if the directory does not exist or an error occurs when trying to determine if the specified directory exists.
Gets the creation date and time of a directory.The path of the directory.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.A structure that is set to the creation date and time for the specified directory. This value is expressed in local time.
Gets the creation date and time, in Coordinated Universal Time (UTC) format, of a directory.The path of the directory.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.A structure that is set to the creation date and time for the specified directory. This value is expressed in UTC time.
Gets the current working directory of the application.The caller does not have the required permission.The operating system is Windows CE, which does not have current directory functionality.
This method is available in the .NET Compact Framework, but is not currently supported.A string that contains the absolute path of the current working directory, and does not end with a backslash (\).
Returns the names of subdirectories (including their paths) in the specified directory.The relative or absolute path to the directory to search. This string is not case-sensitive.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length. is a file name.
-or-
File or directory is corrupted and unreadable (example: invalid first allocation unit of a FAT32 partition).The specified path is invalid (for example, it is on an unmapped drive).An array of the full names (including paths) of subdirectories in the specified path, or an empty array if no directories are found.
Returns the names of subdirectories (including their paths) that match the specified search pattern in the specified directory.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of subdirectories in . This parameter can contain a combination of valid literal and wildcard characters, but it doesn't support regular expressions.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using .
-or-
doesn't contain a valid pattern. or is .The specified path, file name, or both exceed the system-defined maximum length. is a file name.
-or-
File or directory is corrupted and unreadable (example: invalid first allocation unit of a FAT32 partition).The specified path is invalid (for example, it is on an unmapped drive).An array of the full names (including paths) of the subdirectories that match the search pattern in the specified directory, or an empty array if no directories are found.
Returns the names of the subdirectories (including their paths) that match the specified search pattern in the specified directory, and optionally searches subdirectories.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of subdirectories in . This parameter can contain a combination of valid literal and wildcard characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include all subdirectories or only the current directory..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method.
-or-
does not contain a valid pattern. or is . is not a valid value.The caller does not have the required permission.The specified path, file name, or both exceed the system-defined maximum length. is a file name.
-or-
File or directory is corrupted and unreadable (example: invalid first allocation unit of a FAT32 partition).The specified path is invalid (for example, it is on an unmapped drive).An array of the full names (including paths) of the subdirectories that match the specified criteria, or an empty array if no directories are found.
Returns the names of subdirectories (including their paths) that match the specified search pattern and enumeration options in the specified directory.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of subdirectories in . This parameter can contain a combination of valid literal and wildcard characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using .
-or-
doesn't contain a valid pattern. or is .The specified path, file name, or both exceed the system-defined maximum length. is a file name.
-or-
File or directory is corrupted and unreadable (example: invalid first allocation unit of a FAT32 partition).The specified path is invalid (for example, it is on an unmapped drive).An array of the full names (including paths) of the subdirectories that match the search pattern and enumeration options in the specified directory, or an empty array if no directories are found.
Returns the volume information, root information, or both for the specified path.The path of a file or directory.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with . is .The specified path, file name, or both exceed the system-defined maximum length.A string that contains the volume information, root information, or both for the specified path.
Returns the names of files (including their paths) in the specified directory.The relative or absolute path to the directory to search. This string is not case-sensitive. is a file name.
-or-
A network error has occurred.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is not found or is invalid (for example, it is on an unmapped drive).An array of the full names (including paths) for the files in the specified directory, or an empty array if no files are found.
Returns the names of files (including their paths) that match the specified search pattern in the specified directory.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of files in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. is a file name.
-or-
A network error has occurred.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using .
-or-
doesn't contain a valid pattern. or is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is not found or is invalid (for example, it is on an unmapped drive).An array of the full names (including paths) for the files in the specified directory that match the specified search pattern, or an empty array if no files are found.
Returns the names of files (including their paths) that match the specified search pattern in the specified directory, using a value to determine whether to search subdirectories.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of files in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include all subdirectories or only the current directory..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method.
-or-
does not contain a valid pattern. or is . is not a valid value.The caller does not have the required permission.The specified path is not found or is invalid (for example, it is on an unmapped drive).The specified path, file name, or both exceed the system-defined maximum length. is a file name.
-or-
A network error has occurred.An array of the full names (including paths) for the files in the specified directory that match the specified search pattern and option, or an empty array if no files are found.
Returns the names of files (including their paths) that match the specified search pattern and enumeration options in the specified directory.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of subdirectories in . This parameter can contain a combination of valid literal and wildcard characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use. is a file name.
-or-
A network error has occurred.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using .
-or-
doesn't contain a valid pattern. or is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is not found or is invalid (for example, it is on an unmapped drive).An array of the full names (including paths) for the files in the specified directory that match the specified search pattern and enumeration options, or an empty array if no files are found.
Returns the names of all files and subdirectories in a specified path.The relative or absolute path to the directory to search. This string is not case-sensitive.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with . is .The specified path, file name, or both exceed the system-defined maximum length. is a file name.The specified path is invalid (for example, it is on an unmapped drive).An array of the names of files and subdirectories in the specified directory, or an empty array if no files or subdirectories are found.
Returns an array of file names and directory names that match a search pattern in a specified path.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of file and directories in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method.
-or-
does not contain a valid pattern. or is .The specified path, file name, or both exceed the system-defined maximum length. is a file name.The specified path is invalid (for example, it is on an unmapped drive).An array of file names and directory names that match the specified search criteria, or an empty array if no files or directories are found.
Returns an array of all the file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of files and directories in . This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories. The default value is ..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method.
-or-
does not contain a valid pattern. is .
-or-
is . is not a valid value. is invalid, such as referring to an unmapped drive. is a file name.The specified path, file name, or combined exceed the system-defined maximum length.The caller does not have the required permission.The caller does not have the required permission.An array of file the file names and directory names that match the specified search criteria, or an empty array if no files or directories are found.
Returns an array of file names and directory names that match a search pattern and enumeration options in a specified path.The relative or absolute path to the directory to search. This string is not case-sensitive.The search string to match against the names of subdirectories in . This parameter can contain a combination of valid literal and wildcard characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method.
-or-
does not contain a valid pattern. or is .The specified path, file name, or both exceed the system-defined maximum length. is a file name.The specified path is invalid (for example, it is on an unmapped drive).An array of file names and directory names that match the specified search pattern and enumeration options, or an empty array if no files or directories are found.
Returns the date and time the specified file or directory was last accessed.The file or directory for which to obtain access date and time information.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length.The parameter is in an invalid format.A structure that is set to the date and time the specified file or directory was last accessed. This value is expressed in local time.
Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last accessed.The file or directory for which to obtain access date and time information.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length.The parameter is in an invalid format.A structure that is set to the date and time the specified file or directory was last accessed. This value is expressed in UTC time.
Returns the date and time the specified file or directory was last written to.The file or directory for which to obtain modification date and time information.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length.A structure that is set to the date and time the specified file or directory was last written to. This value is expressed in local time.
Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last written to.The file or directory for which to obtain modification date and time information.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length.A structure that is set to the date and time the specified file or directory was last written to. This value is expressed in UTC time.
Retrieves the names of the logical drives on this computer in the form "<drive letter>:\".An I/O error occurred (for example, a disk error).The caller does not have the required permission.The logical drives on this computer.
Retrieves the parent directory of the specified path, including both absolute and relative paths.The path for which to retrieve the parent directory.The directory specified by is read-only.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length. For more information, see the topic.The specified path was not found. is in an invalid format..NET Framework only: The caller does not have the required permissions.The parent directory, or if is the root directory, including the root of a UNC server or share name.
Moves a file or a directory and its contents to a new location.The path of the file or directory to move.The path to the new location for or its contents. If is a file, then must also be a file name.An attempt was made to move a directory to a different volume.
-or-
already exists. See the note in the Remarks section.
-or-
The and parameters refer to the same file or directory.
-or-
The directory or a file within it is being used by another process.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: or is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. or is .The specified path, file name, or both exceed the system-defined maximum length.The path specified by is invalid (for example, it is on an unmapped drive).
Gets the target of the specified directory link.The path of the directory link. to follow links to the final target; to return the immediate next link.The directory on does not exist.
-or-
There are too many levels of symbolic links.A instance if exists, independently if the target exists or not. if is not a link.
Sets the creation date and time for the specified file or directory.The file or directory for which to set the creation date and time information.The date and time the file or directory was last written to. This value is expressed in local time.The specified path was not found..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length.The caller does not have the required permission. specifies a value outside the range of dates or times permitted for this operation.The current operating system is not Windows NT or later.
Sets the creation date and time, in Coordinated Universal Time (UTC) format, for the specified file or directory.The file or directory for which to set the creation date and time information.The date and time the directory or file was created. This value is expressed in local time.The specified path was not found..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length.The caller does not have the required permission. specifies a value outside the range of dates or times permitted for this operation.The current operating system is not Windows NT or later.
Sets the application's current working directory to the specified directory.The path to which the current working directory is set.An I/O error occurred..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length.The caller does not have the required permission to access unmanaged code.The specified path was not found.The specified directory was not found.
Sets the date and time the specified file or directory was last accessed.The file or directory for which to set the access date and time information.An object that contains the value to set for the access date and time of . This value is expressed in local time.The specified path was not found..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length.The caller does not have the required permission.The current operating system is not Windows NT or later. specifies a value outside the range of dates or times permitted for this operation.
Sets the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last accessed.The file or directory for which to set the access date and time information.An object that contains the value to set for the access date and time of . This value is expressed in UTC time.The specified path was not found..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length.The caller does not have the required permission.The current operating system is not Windows NT or later. specifies a value outside the range of dates or times permitted for this operation.
Sets the date and time a directory was last written to.The path of the directory.The date and time the directory was last written to. This value is expressed in local time. was not found (for example, the directory doesn't exist or it is on an unmapped drive). was not found (for example, the directory doesn't exist or it is on an unmapped drive)..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length.The caller does not have the required permission.The current operating system is not Windows NT or later. specifies a value outside the range of dates or times permitted for this operation.
Sets the date and time, in Coordinated Universal Time (UTC) format, that a directory was last written to.The path of the directory.The date and time the directory was last written to. This value is expressed in UTC time. was not found (for example, the directory doesn't exist or it is on an unmapped drive). was not found (for example, the directory doesn't exist or it is on an unmapped drive)..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. is .The specified path, file name, or both exceed the system-defined maximum length.The caller does not have the required permission.The current operating system is not Windows NT or later. specifies a value outside the range of dates or times permitted for this operation.
Exposes instance methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be inherited.
Gets the parent directory of a specified subdirectory.The caller does not have the required permission.The parent directory, or if the path is null or if the file path denotes a root (such as \, C:\, or \\server\share).
Gets the root portion of the directory.The caller does not have the required permission.An object that represents the root of the directory.
Creates a directory.The directory cannot be created.
Creates a subdirectory or subdirectories on the specified path. The specified path can be relative to this instance of the class.The specified path. This cannot be a different disk volume or Universal Naming Convention (UNC) name. does not specify a valid file path or contains invalid characters. is .The specified path is invalid, such as being on an unmapped drive.The subdirectory cannot be created.
-or-
A file already has the name specified by .The specified path, file name, or both exceed the system-defined maximum length.The caller does not have code access permission to create the directory.
-or-
The caller does not have code access permission to read the directory described by the returned object. This can occur when the parameter describes an existing directory. contains a colon character (:) that is not part of a drive label ("C:\").The last directory specified in .
Deletes this instance of a , specifying whether to delete subdirectories and files. to delete this directory, its subdirectories, and all files; otherwise, .The directory contains a read-only file.The directory described by this object does not exist or could not be found.The directory is read-only.
-or-
The directory contains one or more files or subdirectories and is .
-or-
The directory is the application's current working directory.
-or-
There is an open handle on the directory or on one of its files, and the operating system is Windows XP or earlier. This open handle can result from enumerating directories and files. For more information, see How to: Enumerate Directories and Files.The caller does not have the required permission.
Returns an enumerable collection of directory information in the current directory.The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of directories in the current directory.
Returns an enumerable collection of directory information that matches a specified search pattern.The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. is .The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of directories that matches .
Returns an enumerable collection of directory information that matches a specified search pattern and search subdirectory option.The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. The default value is . is . is not a valid value.The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of directories that matches and .
Returns an enumerable collection of directory information that matches the specified search pattern and enumeration options.The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use. is .The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of directories that matches and .
Returns an enumerable collection of file information in the current directory.The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of the files in the current directory.
Returns an enumerable collection of file information that matches a search pattern.The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. is .The path encapsulated in the object is invalid, (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of files that matches .
Returns an enumerable collection of file information that matches a specified search pattern and search subdirectory option.The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. The default value is . is . is not a valid value.The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of files that matches and .
Returns an enumerable collection of file information that matches the specified search pattern and enumeration options.The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use. is .The path encapsulated in the object is invalid, (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of files that matches and .
Returns an enumerable collection of file system information in the current directory.The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of file system information in the current directory.
Returns an enumerable collection of file system information that matches a specified search pattern.The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. is .The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of file system information objects that matches .
Returns an enumerable collection of file system information that matches a specified search pattern and search subdirectory option.The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. The default value is . is . is not a valid value.The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of file system information objects that matches and .
Returns an enumerable collection of file system information that matches the specified search pattern and enumeration options.The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use. is .The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An enumerable collection of file system information objects that matches and .
Returns the subdirectories of the current directory.The path encapsulated in the object is invalid, such as being on an unmapped drive.The caller does not have the required permission.The caller does not have the required permission.An array of objects.
Returns an array of directories in the current matching the given search criteria.The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions..NET Framework and .NET Core versions older than 2.1: contains one or more invalid characters defined by the method. is .The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An array of type matching .
Returns an array of directories in the current matching the given search criteria and using a value to determine whether to search subdirectories.The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories..NET Framework and .NET Core versions older than 2.1: contains one or more invalid characters defined by the method. is . is not a valid value.The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An array of type matching .
Returns an array of directories in the current matching the specified search pattern and enumeration options.The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use..NET Framework and .NET Core versions older than 2.1: contains one or more invalid characters defined by the method. is .The path encapsulated in the object is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An array of type matching and .
Returns a file list from the current directory.The path is invalid, such as being on an unmapped drive.An array of type .
Returns a file list from the current directory matching the given search pattern.The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions..NET Framework and .NET Core versions older than 2.1: contains one or more invalid characters defined by the method. is .The path is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An array of type .
Returns a file list from the current directory matching the given search pattern and using a value to determine whether to search subdirectories.The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories..NET Framework and .NET Core versions older than 2.1: contains one or more invalid characters defined by the method. is . is not a valid value.The path is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An array of type .
Returns a file list from the current directory matching the specified search pattern and enumeration options.The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use..NET Framework and .NET Core versions older than 2.1: contains one or more invalid characters defined by the method. is .The path is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An array of strongly typed objects that match and .
Returns an array of strongly typed entries representing all the files and subdirectories in a directory.The path is invalid (for example, it is on an unmapped drive).An array of strongly typed entries.
Retrieves an array of strongly typed objects representing the files and subdirectories that match the specified search criteria.The search string to match against the names of directories and files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions..NET Framework and .NET Core versions older than 2.1: contains one or more invalid characters defined by the method. is .The specified path is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An array of strongly typed objects matching the search criteria.
Retrieves an array of objects that represent the files and subdirectories matching the specified search criteria.The search string to match against the names of directories and files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. The default value is ..NET Framework and .NET Core versions older than 2.1: contains one or more invalid characters defined by the method. is . is not a valid value.The specified path is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An array of file system entries that match the search criteria.
Retrieves an array of strongly typed objects representing the files and subdirectories that match the specified search pattern and enumeration options.The search string to match against the names of directories and files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.An object that describes the search and enumeration configuration to use..NET Framework and .NET Core versions older than 2.1: contains one or more invalid characters defined by the method. is .The specified path is invalid (for example, it is on an unmapped drive).The caller does not have the required permission.An array of strongly typed objects matching and .
Moves a instance and its contents to a new path.The name and path to which to move this directory. The destination cannot be another disk volume or a directory with the identical name. It can be an existing directory to which you want to add this directory as a subdirectory. is . is an empty string (''").An attempt was made to move a directory to a different volume.
-or-
already exists.
-or-
You are not authorized to access this path.
-or-
The directory being moved and the destination directory have the same name.The caller does not have the required permission.The destination directory cannot be found.
A factory for the creation of wrappers for in a .
Initializes a new instance of a wrapper for which implements .
The fully qualified name of the new directory, or the relative directory name.
Initializes a new instance of a wrapper for which implements .
A string specifying the path on which to create the .
Wraps the in a wrapper for which implements .
Provides access to information on a drive.
Indicates the amount of available free space on a drive, in bytes.Access to the drive information is denied.An I/O error occurred (for example, a disk error or a drive was not ready).The amount of free space available on the drive, in bytes.
Gets the name of the file system, such as NTFS or FAT32.Access to the drive information is denied.The drive does not exist or is not mapped.An I/O error occurred (for example, a disk error or a drive was not ready).The name of the file system on the specified drive.
Gets the drive type, such as CD-ROM, removable, network, or fixed.One of the enumeration values that specifies a drive type.
Gets a value that indicates whether a drive is ready. if the drive is ready; if the drive is not ready.
Gets the name of a drive, such as C:\.The name of the drive.
Gets the root directory of a drive.An object that contains the root directory of the drive.
Gets the total amount of free space available on a drive, in bytes.Access to the drive information is denied.The drive is not mapped or does not exist.An I/O error occurred (for example, a disk error or a drive was not ready).The total free space available on a drive, in bytes.
Gets the total size of storage space on a drive, in bytes.Access to the drive information is denied.The drive is not mapped or does not exist.An I/O error occurred (for example, a disk error or a drive was not ready).The total size of the drive, in bytes.
Gets or sets the volume label of a drive.An I/O error occurred (for example, a disk error or a drive was not ready).The drive is not mapped or does not exist.The caller does not have the required permission.The volume label is being set on a network or CD-ROM drive.
-or-
Access to the drive information is denied.The volume label.
A factory for the creation of wrappers for in a .
Initializes a new instance of a wrapper for which implements .
A valid drive path or drive letter.
Retrieves the drive names of all logical drives on a computer.
An array of type that represents the logical drives on a computer.
Provides access to the information on the specified drive.
A valid drive path or drive letter.
This can be either uppercase or lowercase, 'a' to 'z'.
A value is not valid.
Wraps the in a wrapper for which implements .
Abstractions for .
Asynchronously appends lines to a file, and then closes the file. If the specified file does not exist, this method creates a file, writes the specified lines to the file, and then closes the file.The file to append the lines to. The file is created if it doesn't already exist.The lines to append to the file.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous append operation.
Asynchronously appends lines to a file by using a specified encoding, and then closes the file. If the specified file does not exist, this method creates a file, writes the specified lines to the file, and then closes the file.The file to append the lines to. The file is created if it doesn't already exist.The lines to append to the file.The character encoding to use.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous append operation.
Asynchronously opens a file or creates a file if it does not already exist, appends the specified string to the file, and then closes the file.The file to append the specified string to.The string to append to the file.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous append operation.
Asynchronously opens a file or creates the file if it does not already exist, appends the specified string to the file using the specified encoding, and then closes the file.The file to append the specified string to.The string to append to the file.The character encoding to use.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous append operation.
Asynchronously opens a binary file, reads the contents of the file into a byte array, and then closes the file.The file to open for reading.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous read operation, which wraps the byte array containing the contents of the file.
Asynchronously opens a text file, reads all lines of the file, and then closes the file.The file to open for reading.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous read operation, which wraps the string array containing all lines of the file.
Asynchronously opens a text file, reads all lines of the file with the specified encoding, and then closes the file.The file to open for reading.The encoding applied to the contents of the file.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous read operation, which wraps the string array containing all lines of the file.
Asynchronously opens a text file, reads all the text in the file, and then closes the file.The file to open for reading.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous read operation, which wraps the string containing all text in the file.
Asynchronously opens a text file, reads all text in the file with the specified encoding, and then closes the file.The file to open for reading.The encoding applied to the contents of the file.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous read operation, which wraps the string containing all text in the file.
Asynchronously reads the lines of a file.The file to read.The token to monitor for cancellation requests. The default value is .The async enumerable that represents all the lines of the file, or the lines that are the result of a query.
Asynchronously reads the lines of a file that has a specified encoding.The file to read.The encoding that is applied to the contents of the file.The token to monitor for cancellation requests. The default value is .The async enumerable that represents all the lines of the file, or the lines that are the result of a query.
Asynchronously creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.The file to write to.The bytes to write to the file.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous write operation.
Asynchronously creates a new file, writes the specified lines to the file, and then closes the file.The file to write to.The lines to write to the file.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous write operation.
Asynchronously creates a new file, write the specified lines to the file by using the specified encoding, and then closes the file.The file to write to.The lines to write to the file.The character encoding to use.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous write operation.
Asynchronously creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten.The file to write to.The string to write to the file.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous write operation.
Asynchronously creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.The file to write to.The string to write to the file.The encoding to apply to the string.The token to monitor for cancellation requests. The default value is .A task that represents the asynchronous write operation.
Appends lines to a file, and then closes the file. If the specified file does not exist, this method creates a file, writes the specified lines to the file, and then closes the file.The file to append the lines to. The file is created if it doesn't already exist.The lines to append to the file. is a zero-length string, contains only white space, or contains one more invalid characters defined by the method.Either or is . is invalid (for example, the directory doesn't exist or it is on an unmapped drive).The file specified by was not found.An I/O error occurred while opening the file. exceeds the system-defined maximum length. is in an invalid format.The caller does not have permission to write to the file. specifies a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
is a directory.
Appends lines to a file by using a specified encoding, and then closes the file. If the specified file does not exist, this method creates a file, writes the specified lines to the file, and then closes the file.The file to append the lines to. The file is created if it doesn't already exist.The lines to append to the file.The character encoding to use. is a zero-length string, contains only white space, or contains one more invalid characters defined by the method.Either , , or is . is invalid (for example, the directory doesn't exist or it is on an unmapped drive).The file specified by was not found.An I/O error occurred while opening the file. exceeds the system-defined maximum length. is in an invalid format.The caller does not have the required permission. specifies a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
is a directory.
-or-
The caller does not have the required permission.
Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.The file to append the specified string to.The string to append to the file..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, the directory doesn't exist or it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission. is in an invalid format.The caller does not have the required permission.
Appends the specified string to the file using the specified encoding, creating the file if it does not already exist.The file to append the specified string to.The string to append to the file.The character encoding to use..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, the directory doesn't exist or it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission. is in an invalid format.The caller does not have the required permission.
Creates a that appends UTF-8 encoded text to an existing file, or to a new file if the specified file does not exist.The path to the file to append to.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, the directory doesn't exist or it is on an unmapped drive). is in an invalid format.A stream writer that appends UTF-8 encoded text to the specified file or to a new file.
Copies an existing file to a new file. Overwriting a file of the same name is not allowed.The file to copy.The name of the destination file. This cannot be a directory or an existing file.The caller does not have the required permission. or is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method.
-or-
or specifies a directory. or is .The specified path, file name, or both exceed the system-defined maximum length.The path specified in or is invalid (for example, it is on an unmapped drive). was not found. exists.
-or-
An I/O error has occurred. or is in an invalid format.
Copies an existing file to a new file. Overwriting a file of the same name is allowed.The file to copy.The name of the destination file. This cannot be a directory. if the destination file can be overwritten; otherwise, .The caller does not have the required permission.
-or-
is read-only.
-or-
is , exists and is hidden, but is not hidden. or is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method.
-or-
or specifies a directory. or is .The specified path, file name, or both exceed the system-defined maximum length.The path specified in or is invalid (for example, it is on an unmapped drive). was not found. exists and is .
-or-
An I/O error has occurred. or is in an invalid format.
Creates or overwrites a file in the specified path.The path and name of the file to create.The caller does not have the required permission.
-or-
specified a file that is read-only.
-or-
specified a file that is hidden..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while creating the file. is in an invalid format.A that provides read/write access to the file specified in .
Creates or overwrites a file in the specified path, specifying a buffer size.The path and name of the file to create.The number of bytes buffered for reads and writes to the file.The caller does not have the required permission.
-or-
specified a file that is read-only.
-or-
specified a file that is hidden..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while creating the file. is in an invalid format.A with the specified buffer size that provides read/write access to the file specified in .
Creates or overwrites a file in the specified path, specifying a buffer size and options that describe how to create or overwrite the file.The path and name of the file to create.The number of bytes buffered for reads and writes to the file.One of the values that describes how to create or overwrite the file.The caller does not have the required permission.
-or-
specified a file that is read-only.
-or-
specified a file that is hidden..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive.An I/O error occurred while creating the file. is in an invalid format.A new file with the specified buffer size.
Creates a file symbolic link identified by that points to .The path where the symbolic link should be created.The path of the target to which the symbolic link points. or is . or is empty.
-or-
or contains a character.A file or directory already exists in the location of .
-or-
An I/O error occurred.A instance that wraps the newly created file symbolic link.
Creates or opens a file for writing UTF-8 encoded text. If the file already exists, its contents are overwritten.The file to be opened for writing.The caller does not have the required permission.
-or-
specified a file that is read-only.
-or-
specified a file that is hidden..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive). is in an invalid format.A that writes to the specified file using UTF-8 encoding.
Decrypts a file that was encrypted by the current account using the method.A path that describes a file to decrypt..NET Framework and .NET Core versions older than 2.1: The parameter is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method.The parameter is .An invalid drive was specified.The file described by the parameter could not be found.An I/O error occurred while opening the file. For example, the encrypted file is already open.
-or-
This operation is not supported on the current platform.The specified path, file name, or both exceed the system-defined maximum length.The current operating system is not Windows NT or later.The file system is not NTFS.The parameter specified a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
The parameter specified a directory.
-or-
The caller does not have the required permission.
Deletes the specified file.The name of the file to be deleted. Wildcard characters are not supported..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path is invalid (for example, it is on an unmapped drive).The specified file is in use.
-or-
There is an open handle on the file, and the operating system is Windows XP or earlier. This open handle can result from enumerating directories and files. For more information, see How to: Enumerate Directories and Files. is in an invalid format.The specified path, file name, or both exceed the system-defined maximum length.The caller does not have the required permission.
-or-
The file is an executable file that is in use.
-or-
is a directory.
-or-
specified a read-only file.
Encrypts a file so that only the account used to encrypt the file can decrypt it.A path that describes a file to encrypt..NET Framework and .NET Core versions older than 2.1: The parameter is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method.The parameter is .An invalid drive was specified.The file described by the parameter could not be found.An I/O error occurred while opening the file.
-or-
This operation is not supported on the current platform.The specified path, file name, or both exceed the system-defined maximum length.The current operating system is not Windows NT or later.The file system is not NTFS.The parameter specified a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
The parameter specified a directory.
-or-
The caller does not have the required permission.
Determines whether the specified file exists.The file to check. if the caller has the required permissions and contains the name of an existing file; otherwise, . This method also returns if is , an invalid path, or a zero-length string. If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returns regardless of the existence of .
Gets the of the file on the path.The path to the file..NET Framework and .NET Core versions older than 2.1: is empty, contains only white spaces, or contains invalid characters.The specified path, file name, or both exceed the system-defined maximum length. is in an invalid format. represents a file and is invalid, such as being on an unmapped drive, or the file cannot be found. represents a directory and is invalid, such as being on an unmapped drive, or the directory cannot be found.This file is being used by another process.The caller does not have the required permission.The of the file on the path.
Gets the specified of the file or directory associated with .A to the file or directory for which the attributes are to be retrieved. is .The caller does not have the required permission.The of the file or directory.
Returns the creation date and time of the specified file or directory.The file or directory for which to obtain creation date and time information.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length. is in an invalid format.A structure set to the creation date and time for the specified file or directory. This value is expressed in local time.
Returns the creation time of the specified file or directory.A to the file or directory for which to obtain creation date and time information. is .The caller does not have the required permission.A structure set to the creation date and time for the specified file or directory. This value is expressed in local time.
Returns the creation date and time, in Coordinated Universal Time (UTC), of the specified file or directory.The file or directory for which to obtain creation date and time information.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length. is in an invalid format.A structure set to the creation date and time for the specified file or directory. This value is expressed in UTC time.
Returns the creation date and time, in Coordinated Universal Time (UTC), of the specified file or directory.A to the file or directory for which to obtain creation date and time information. is .The caller does not have the required permission.A structure set to the creation date and time for the specified file or directory. This value is expressed in UTC time.
Returns the date and time the specified file or directory was last accessed.The file or directory for which to obtain access date and time information.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length. is in an invalid format.A structure set to the date and time that the specified file or directory was last accessed. This value is expressed in local time.
Returns the last access date and time of the specified file or directory.A to the file or directory for which to obtain last access date and time information. is .The caller does not have the required permission.A structure set to the last access date and time for the specified file or directory. This value is expressed in local time.
Returns the date and time, in Coordinated Universal Time (UTC), that the specified file or directory was last accessed.The file or directory for which to obtain access date and time information.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length. is in an invalid format.A structure set to the date and time that the specified file or directory was last accessed. This value is expressed in UTC time.
Returns the last access date and time, in Coordinated Universal Time (UTC), of the specified file or directory.A to the file or directory for which to obtain last access date and time information. is .The caller does not have the required permission.A structure set to the last access date and time for the specified file or directory. This value is expressed in UTC time.
Returns the date and time the specified file or directory was last written to.The file or directory for which to obtain write date and time information.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length. is in an invalid format.A structure set to the date and time that the specified file or directory was last written to. This value is expressed in local time.
Returns the last write date and time of the specified file or directory.A to the file or directory for which to obtain last write date and time information. is .The caller does not have the required permission.A structure set to the last write date and time for the specified file or directory. This value is expressed in local time.
Returns the date and time, in Coordinated Universal Time (UTC), that the specified file or directory was last written to.The file or directory for which to obtain write date and time information.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length. is in an invalid format.A structure set to the date and time that the specified file or directory was last written to. This value is expressed in UTC time.
Returns the last write date and time, in Coordinated Universal Time (UTC), of the specified file or directory.A to the file or directory for which to obtain last write date and time information. is .The caller does not have the required permission.A structure set to the last write date and time for the specified file or directory. This value is expressed in UTC time.
Gets the of the file on the path.The path to the file. is a zero-length string, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The caller does not have the required permission.The specified path exceeds the system-defined maximum length.A component of the is not a directory.The file cannot be found.The of the file on the path.
Gets the of the specified file handle.The file handle.The file is closed.The of the file handle.
Moves a specified file to a new location, providing the option to specify a new file name.The name of the file to move. Can include a relative or absolute path.The new path and name for the file. already exists.
-or-
An I/O error has occurred, e.g. while copying the file across disk volumes. was not found. or is ..NET Framework and .NET Core versions older than 2.1: or is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method.The caller does not have the required permission.The specified path, file name, or both exceed the system-defined maximum length.The path specified in or is invalid, (for example, it is on an unmapped drive). or is in an invalid format.
Moves a specified file to a new location, providing the options to specify a new file name and to overwrite the destination file if it already exists.The name of the file to move. Can include a relative or absolute path.The new path and name for the file. to overwrite the destination file if it already exists; otherwise. already exists and is .
-or-
An I/O error has occurred, e.g. while copying the file across disk volumes. was not found. or is ..NET Framework and .NET Core versions older than 2.1: or is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method.The caller does not have the required permission.
-or-
The Operating System has failed to acquire an exclusive access to the destination file.The specified path, file name, or both exceed the system-defined maximum length.The path specified in or is invalid, (for example, it is on an unmapped drive). or is in an invalid format.
Opens a on the specified path with read/write access with no sharing.The file to open.A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid, (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission.
-or-
is and the specified file is a hidden file. specified an invalid value.The file specified in was not found. is in an invalid format.A opened in the specified mode and path, with read/write access and not shared.
Opens a on the specified path, with the specified mode and access with no sharing.The file to open.A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten.A value that specifies the operations that can be performed on the file..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method.
-or-
specified and specified , , , or . is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid, (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only and is not .
-or-
specified a directory.
-or-
The caller does not have the required permission.
-or-
is and the specified file is a hidden file. or specified an invalid value.The file specified in was not found. is in an invalid format.An unshared that provides access to the specified file, with the specified mode and access.
Opens a on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option.The file to open.A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten.A value that specifies the operations that can be performed on the file.A value specifying the type of access other threads have to the file..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method.
-or-
specified and specified , , , or . is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid, (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only and is not .
-or-
specified a directory.
-or-
The caller does not have the required permission.
-or-
is and the specified file is a hidden file., , or specified an invalid value.The file specified in was not found. is in an invalid format.A on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option.
Initializes a new instance of the class with the specified path, creation mode, read/write and sharing permission, the access other FileStreams can have to the same file, the buffer size, additional file options and the allocation size.The path of the file to open.An object that describes optional parameters to use.A instance that wraps the opened file.
Opens an existing file for reading.The file to be opened for reading..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid, (for example, it is on an unmapped drive). specified a directory.
-or-
The caller does not have the required permission.The file specified in was not found. is in an invalid format.An I/O error occurred while opening the file.A read-only on the specified path.
Opens an existing UTF-8 encoded text file for reading.The file to be opened for reading.The caller does not have the required permission..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid, (for example, it is on an unmapped drive).The file specified in was not found. is in an invalid format.A on the specified path.
Opens an existing file or creates a new file for writing.The file to be opened for writing.The caller does not have the required permission.
-or-
specified a read-only file or directory..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid, (for example, it is on an unmapped drive). is in an invalid format.An unshared object on the specified path with access.
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.The file to open for reading..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file.This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission.The file specified in was not found. is in an invalid format.The caller does not have the required permission.A byte array containing the contents of the file.
Opens a text file, reads all lines of the file, and then closes the file.The file to open for reading..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission.The file specified in was not found. is in an invalid format.The caller does not have the required permission.A string array containing all lines of the file.
Opens a file, reads all lines of the file with the specified encoding, and then closes the file.The file to open for reading.The encoding applied to the contents of the file..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission.The file specified in was not found. is in an invalid format.The caller does not have the required permission.A string array containing all lines of the file.
Opens a text file, reads all the text in the file, and then closes the file.The file to open for reading..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission.The file specified in was not found. is in an invalid format.The caller does not have the required permission.A string containing all the text in the file.
Opens a file, reads all text in the file with the specified encoding, and then closes the file.The file to open for reading.The encoding applied to the contents of the file..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission.The file specified in was not found. is in an invalid format.The caller does not have the required permission.A string containing all text in the file.
Reads the lines of a file.The file to read..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method. is . is invalid (for example, it is on an unmapped drive).The file specified by was not found.An I/O error occurred while opening the file. exceeds the system-defined maximum length.The caller does not have the required permission. specifies a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
is a directory.
-or-
The caller does not have the required permission.All the lines of the file, or the lines that are the result of a query.
Read the lines of a file that has a specified encoding.The file to read.The encoding that is applied to the contents of the file..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters as defined by the method. is . is invalid (for example, it is on an unmapped drive).The file specified by was not found.An I/O error occurred while opening the file. exceeds the system-defined maximum length.The caller does not have the required permission. specifies a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
is a directory.
-or-
The caller does not have the required permission.All the lines of the file, or the lines that are the result of a query.
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.The name of a file that replaces the file specified by .The name of the file being replaced.The name of the backup 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 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.An I/O error occurred while opening the file.
-or-
The and parameters 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.
-or-
This operation is not supported on the current platform.
-or-
Source or destination parameters specify a directory instead of a file.
-or-
The caller does not have the required permission.
-or
and specify the same existing directory.
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.The name of a file that replaces the file specified by .The name of the file being replaced.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, .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 .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.An I/O error occurred while opening the file.
-or-
The and parameters 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.
-or-
This operation is not supported on the current platform.
-or-
Source or destination parameters specify a directory instead of a file.
-or-
The caller does not have the required permission.
-or
and specify the same existing directory.
Gets the target of the specified file link.The path of the file link. to follow links to the final target; to return the immediate next link.The file on does not exist.
-or-
There are too many levels of symbolic links.A instance if exists, independently if the target exists or not. if is not a link.
Sets the specified of the file on the specified path.The path to the file.A bitwise combination of the enumeration values..NET Framework and .NET Core versions older than 2.1: is empty, contains only white spaces, contains invalid characters, or the file attribute is invalid.The specified path, file name, or both exceed the system-defined maximum length. is in an invalid format.The specified path is invalid, (for example, it is on an unmapped drive).The file cannot be found. specified a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission.
Sets the specified of the file or directory associated with .A to the file or directory for which should be set.A bitwise combination of the enumeration values. is .The caller does not have the required permission.
Sets the date and time the file was created.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 local time.The specified path was not found..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .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.The caller does not have the required permission. is in an invalid format.
Sets the date and time the file or directory was created.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 local time. is . specifies a value outside the range of dates, times, or both permitted for this operation.The caller does not have the required permission.An I/O error occurred while performing the operation.
Sets the date and time, in Coordinated Universal Time (UTC), that the file was created.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 specified path was not found..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .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.The caller does not have the required permission. is in an invalid format.
Sets the date and time, in Coordinated Universal Time (UTC), that the file or directory was created.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. is . specifies a value outside the range of dates, times, or both permitted for this operation.The caller does not have the required permission.An I/O error occurred while performing the operation.
Sets the date and time the specified file was last accessed.The file for which to set the access date and time information.A containing the value to set for the last access date and time of . This value is expressed in local time..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path was not found.The caller does not have the required permission. is in an invalid format. specifies a value outside the range of dates or times permitted for this operation.
Sets the date and time the specified file or directory was last accessed.A to the file or directory for which to set the last access date and time information.A containing the value to set for the last access date and time of .
This value is expressed in local time. is . specifies a value outside the range of dates, times, or both permitted for this operation.The caller does not have the required permission.An I/O error occurred while performing the operation.
Sets the date and time, in Coordinated Universal Time (UTC), that the specified file was last accessed.The file for which to set the access date and time information.A containing the value to set for the last access date and time of . This value is expressed in UTC time..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path was not found.The caller does not have the required permission. is in an invalid format. specifies a value outside the range of dates or times permitted for this operation.
Sets the date and time, in Coordinated Universal Time (UTC), that the specified file or directory was last accessed.A to the file or directory for which to set the last access date and time information.A containing the value to set for the last access date and time of .
This value is expressed in UTC time. is . specifies a value outside the range of dates, times, or both permitted for this operation.The caller does not have the required permission.An I/O error occurred while performing the operation.
Sets the date and time that the specified file was last written to.The file for which to set the date and time information.A containing the value to set for the last write date and time of . This value is expressed in local time..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path was not found.The caller does not have the required permission. is in an invalid format. specifies a value outside the range of dates or times permitted for this operation.
Sets the date and time that the specified file or directory was last written to.A to the file or directory for which to set the last write date and time information.A containing the value to set for the last write date and time of .
This value is expressed in local time. is . specifies a value outside the range of dates, times, or both permitted for this operation.The caller does not have the required permission.An I/O error occurred while performing the operation.
Sets the date and time, in Coordinated Universal Time (UTC), that the specified file was last written to.The file for which to set the date and time information.A containing the value to set for the last write date and time of . This value is expressed in UTC time..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path was not found.The caller does not have the required permission. is in an invalid format. specifies a value outside the range of dates or times permitted for this operation.
Sets the date and time, in Coordinated Universal Time (UTC), that the specified file or directory was last written to.A to the file or directory for which to set the last write date and time information.A containing the value to set for the last write date and time of .
This value is expressed in UTC time. is . specifies a value outside the range of dates, times, or both permitted for this operation.The caller does not have the required permission.An I/O error occurred while performing the operation.
Sets the specified of the file on the specified path.The path to the file.The Unix file mode. is a zero-length string, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The file mode is invalid.The caller does not have the required permission.The specified path exceeds the system-defined maximum length.A component of the is not a directory.The file cannot be found.
Sets the specified of the specified file handle.The file handle.The Unix file mode.The file mode is invalid.The caller does not have the required permission.The file is closed.
Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.The file to write to.The bytes to write to the file..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is or the byte array is empty.The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
specified a file that is hidden.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission. is in an invalid format.The caller does not have the required permission.
Creates a new file, write the specified string array to the file, and then closes the file.The file to write to.The string array to write to the file..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method.Either or is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
specified a file that is hidden.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission. is in an invalid format.The caller does not have the required permission.
Creates a new file, writes a collection of strings to the file, and then closes the file.The file to write to.The lines to write to the file..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method.Either or is . is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file. exceeds the system-defined maximum length. is in an invalid format.The caller does not have the required permission. specified a file that is read-only.
-or-
specified a file that is hidden.
-or-
This operation is not supported on the current platform.
-or-
is a directory.
-or-
The caller does not have the required permission.
Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file.The file to write to.The string array to write to the file.An object that represents the character encoding applied to the string array..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method.Either or is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
specified a file that is hidden.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission. is in an invalid format.The caller does not have the required permission.
Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.The file to write to.The lines to write to the file.The character encoding to use..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method.Either , , or is . is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file. exceeds the system-defined maximum length. is in an invalid format.The caller does not have the required permission. specified a file that is read-only.
-or-
specified a file that is hidden.
-or-
This operation is not supported on the current platform.
-or-
is a directory.
-or-
The caller does not have the required permission.
Creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten.The file to write to.The string to write to the file..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
specified a file that is hidden.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission. is in an invalid format.The caller does not have the required permission.
Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.The file to write to.The string to write to the file.The encoding to apply to the string..NET Framework and .NET Core versions older than 2.1: is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. is .The specified path, file name, or both exceed the system-defined maximum length.The specified path is invalid (for example, it is on an unmapped drive).An I/O error occurred while opening the file. specified a file that is read-only.
-or-
specified a file that is hidden.
-or-
This operation is not supported on the current platform.
-or-
specified a directory.
-or-
The caller does not have the required permission. is in an invalid format.The caller does not have the required permission.
Provides properties and instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of objects. This class cannot be inherited.
Gets an instance of the parent directory.The specified path is invalid, such as being on an unmapped drive.The caller does not have the required permission.A object representing the parent directory of this file.
Gets a string representing the directory's full path. was passed in for the directory name.The fully qualified path name exceeds the system-defined maximum length.The caller does not have the required permission.A string representing the directory's full path.
Gets or sets a value that determines if the current file is read only.The file described by the current object could not be found when trying to set the IsReadOnly property. (Note that getting this property for a nonexistent file will not throw an exception, but rather returns .)An I/O error occurred while opening the file.This operation is not supported on the current platform.
-or-
The caller does not have the required permission.The user does not have write permission, but attempted to set this property to . if the current file is read only or could not be found; otherwise, .
Gets the size, in bytes, of the current file. cannot update the state of the file or directory.The file does not exist.
-or-
The property is called for a directory.The size of the current file in bytes.
Creates a that appends text to the file represented by this instance of the .A new .
Copies an existing file to a new file, disallowing the overwriting of an existing file.The name of the new file to copy to..NET Framework and .NET Core versions older than 2.1: is empty, contains only white spaces, or contains invalid characters.An error occurs, or the destination file already exists.The caller does not have the required permission. is .A directory path is passed in, or the file is being moved to a different drive.The directory specified in does not exist.The specified path, file name, or both exceed the system-defined maximum length. contains a colon (:) within the string but does not specify the volume.A new file with a fully qualified path.
Copies an existing file to a new file, allowing the overwriting of an existing file.The name of the new file to copy to. to allow an existing file to be overwritten; otherwise, ..NET Framework and .NET Core versions older than 2.1: is empty, contains only white spaces, or contains invalid characters.An error occurs, or the destination file already exists and is .The caller does not have the required permission. is .The directory specified in does not exist.A directory path is passed in, or the file is being moved to a different drive.The specified path, file name, or both exceed the system-defined maximum length. contains a colon (:) in the middle of the string.A new file, or an overwrite of an existing file if is . If the file exists and is , an is thrown.
Creates a file.A new file.
Creates a that writes a new text file.The file name is a directory.The disk is read-only.The caller does not have the required permission.A new .
Decrypts a file that was encrypted by the current account using the method.An invalid drive was specified.The file described by the current object could not be found.An I/O error occurred while opening the file.The file system is not NTFS.The current operating system is not Microsoft Windows NT or later.The file described by the current object is read-only.
-or-
This operation is not supported on the current platform.
-or-
The caller does not have the required permission.
Encrypts a file so that only the account used to encrypt the file can decrypt it.An invalid drive was specified.The file described by the current object could not be found.An I/O error occurred while opening the file.The file system is not NTFS.The current operating system is not Microsoft Windows NT or later.The file described by the current object is read-only.
-or-
This operation is not supported on the current platform.
-or-
The caller does not have the required permission.
Moves a specified file to a new location, providing the option to specify a new file name.The path to move the file to, which can specify a different file name.An I/O error occurs, such as the destination file already exists or the destination device is not ready. is ..NET Framework and .NET Core versions older than 2.1: is empty, contains only white spaces, or contains invalid characters.The caller does not have the required permission. is read-only or is a directory.The file is not found.The specified path is invalid, such as being on an unmapped drive.The specified path, file name, or both exceed the system-defined maximum length. contains a colon (:) in the middle of the string.
Moves a specified file to a new location, providing the options to specify a new file name and to overwrite the destination file if it already exists.The path to move the file to, which can specify a different file name. to overwrite the destination file if it already exists; otherwise.An I/O error occurred, such as the destination device is not ready. is ..NET Framework and .NET Core versions older than 2.1: is empty, contains only white spaces, or contains invalid characters.The caller does not have the required permission. is read-only or is a directory.The file is not found.The specified path is invalid, such as being on an unmapped drive.The specified path, file name, or both exceed the system-defined maximum length. contains a colon (:) in the middle of the string.
Opens a file in the specified mode.A constant specifying the mode (for example, or ) in which to open the file.The file is not found.The file is read-only or is a directory.The specified path is invalid, such as being on an unmapped drive.The file is already open.A file opened in the specified mode, with read/write access and unshared.
Opens a file in the specified mode with read, write, or read/write access.A constant specifying the mode (for example, or ) in which to open the file.A constant specifying whether to open the file with , , or file access.The caller does not have the required permission.The file is not found. is read-only or is a directory.The specified path is invalid, such as being on an unmapped drive.The file is already open. is empty or contains only white spaces.One or more arguments is null.A object opened in the specified mode and access, and unshared.
Opens a file in the specified mode with read, write, or read/write access and the specified sharing option.A constant specifying the mode (for example, or ) in which to open the file.A constant specifying whether to open the file with , , or file access.A constant specifying the type of access other objects have to this file.The caller does not have the required permission.The file is not found. is read-only or is a directory.The specified path is invalid, such as being on an unmapped drive.The file is already open. is empty or contains only white spaces.One or more arguments is null.A object opened with the specified mode, access, and sharing options.
Initializes a new instance of the class with the specified creation mode, read/write and sharing permission, the access other FileStreams can have to the same file, the buffer size, additional file options and the allocation size.An object that describes optional parameters to use.A that wraps the opened file.
Creates a read-only . is read-only or is a directory.The specified path is invalid, such as being on an unmapped drive.The file is already open.A new read-only object.
Creates a with UTF8 encoding that reads from an existing text file.The caller does not have the required permission.The file is not found. is read-only or is a directory.The specified path is invalid, such as being on an unmapped drive.A new with UTF8 encoding.
Creates a write-only .The path specified when creating an instance of the object is read-only or is a directory.The path specified when creating an instance of the object is invalid, such as being on an unmapped drive.A write-only unshared object for a new or existing 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.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 file described by the current object could not be found.
-or-
The file described by the parameter could not be found.The current operating system is not Microsoft Windows NT or later.A object that encapsulates information about 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. Also specifies whether to ignore merge errors.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. to ignore merge errors (such as attributes and ACLs) from the replaced file to the replacement file; otherwise .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 file described by the current object could not be found.
-or-
The file described by the parameter could not be found.The current operating system is not Microsoft Windows NT or later.A object that encapsulates information about the file described by the parameter.
A factory for the creation of wrappers for in a .
Initializes a new instance of a wrapper for which implements .
The fully qualified name of the new file, or the relative file name.
Initializes a new instance of a wrapper for which implements .
The fully qualified name of the new file, or the relative file name.
Do not end the path with the directory separator character.
Wraps the in a wrapper for which implements .
A factory for the creation of wrappers for in a .
Initializes a new instance of the class with the specified path and creation mode.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. is .The caller does not have the required permission.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes. specifies a file that is read-only.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The specified path is invalid, such as being on an unmapped drive.The specified path, file name, or both exceed the system-defined maximum length. contains an invalid value.
Initializes a new instance of the class with the specified path, creation mode, and read/write permission.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file.A bitwise combination of the enumeration values that determines how the file can be accessed by the object. This also determines the values returned by the and properties of the object. is if specifies a disk file. is ..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The specified path is invalid, such as being on an unmapped drive.The requested is not permitted by the operating system for the specified , such as when is or and the file or directory is set for read-only access.The specified path, file name, or both exceed the system-defined maximum length. contains an invalid value.
Initializes a new instance of the class with the specified path, creation mode, read/write permission, and sharing permission.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file.A bitwise combination of the enumeration values that determines how the file can be accessed by the object. This also determines the values returned by the and properties of the object. is if specifies a disk file.A bitwise combination of the enumeration values that determines how the file will be shared by processes. is ..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The specified path is invalid, such as being on an unmapped drive.The requested is not permitted by the operating system for the specified , such as when is or and the file or directory is set for read-only access.The specified path, file name, or both exceed the system-defined maximum length. contains an invalid value.
Initializes a new instance of the class with the specified path, creation mode, read/write and sharing permission, and buffer size.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file.A bitwise combination of the enumeration values that determines how the file can be accessed by the object. This also determines the values returned by the and properties of the object. is if specifies a disk file.A bitwise combination of the enumeration values that determines how the file will be shared by processes.A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. is ..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. is negative or zero.
-or-
, , or contain an invalid value.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The specified path is invalid, such as being on an unmapped drive.The requested is not permitted by the operating system for the specified , such as when is or and the file or directory is set for read-only access.The specified path, file name, or both exceed the system-defined maximum length.
Initializes a new instance of the class with the specified path, creation mode, read/write and sharing permission, the access other FileStreams can have to the same file, the buffer size, and additional file options.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file.A bitwise combination of the enumeration values that determines how the file can be accessed by the object. This also determines the values returned by the and properties of the object. is if specifies a disk file.A bitwise combination of the enumeration values that determines how the file will be shared by processes.A positive value greater than 0 indicating the buffer size. The default buffer size is 4096.A bitwise combination of the enumeration values that specifies additional file options. is ..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. is negative or zero.
-or-
, , or contain an invalid value.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The specified path is invalid, such as being on an unmapped drive.The requested is not permitted by the operating system for the specified , such as when is or and the file or directory is set for read-only access.
-or-
is specified for , but file encryption is not supported on the current platform.The specified path, file name, or both exceed the system-defined maximum length.
Initializes a new instance of the class with the specified path, creation mode, read/write and sharing permission, buffer size, and synchronous or asynchronous state.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file.A bitwise combination of the enumeration values that determines how the file can be accessed by the object. This also determines the values returned by the and properties of the object. is if specifies a disk file.A bitwise combination of the enumeration values that determines how the file will be shared by processes.A positive value greater than 0 indicating the buffer size. The default buffer size is 4096.Specifies whether to use asynchronous I/O or synchronous I/O. However, note that the underlying operating system might not support asynchronous I/O, so when specifying , the handle might be opened synchronously depending on the platform. When opened asynchronously, the and methods perform better on large reads or writes, but they might be much slower for small reads or writes. If the application is designed to take advantage of asynchronous I/O, set the parameter to . Using asynchronous I/O correctly can speed up applications by as much as a factor of 10, but using it without redesigning the application for asynchronous I/O can decrease performance by as much as a factor of 10. is ..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. is negative or zero.
-or-
, , or contain an invalid value.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The specified path is invalid, such as being on an unmapped drive.The requested is not permitted by the operating system for the specified , such as when is or and the file or directory is set for read-only access.The specified path, file name, or both exceed the system-defined maximum length.
Initializes a new instance of the class for the specified file handle, with the specified read/write permission.A file handle for the file that the current object will encapsulate.A bitwise combination of the enumeration values that sets the and properties of the object. is not a field of .The caller does not have the required permission.An I/O error, such as a disk error, occurred.
-or-
The stream has been closed.The requested is not permitted by the operating system for the specified file handle, such as when is or and the file handle is set for read-only access.
Initializes a new instance of the class for the specified file handle, with the specified read/write permission, and buffer size.A file handle for the file that the current object will encapsulate.A constant that sets the and properties of the object.A positive value greater than 0 indicating the buffer size. The default buffer size is 4096.The parameter is an invalid handle.
-or-
The parameter is a synchronous handle and it was used asynchronously.The parameter is negative.An I/O error, such as a disk error, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The requested is not permitted by the operating system for the specified file handle, such as when is or and the file handle is set for read-only access.
Initializes a new instance of the class for the specified file handle, with the specified read/write permission, buffer size, and synchronous or asynchronous state.A file handle for the file that this object will encapsulate.A bitwise combination of the enumeration values that sets the and properties of the object.A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. if the handle was opened asynchronously (that is, in overlapped I/O mode); otherwise, .The parameter is an invalid handle.
-or-
The parameter is a synchronous handle and it was used asynchronously.The parameter is negative.An I/O error, such as a disk error, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The requested is not permitted by the operating system for the specified file handle, such as when is or and the file handle is set for read-only access.
Initializes a new instance of the class for the specified file handle, with the specified read/write permission.A file handle for the file that the current object will encapsulate.A bitwise combination of the enumeration values that sets the and properties of the object. is not a field of .The caller does not have the required permission.An I/O error, such as a disk error, occurred.
-or-
The stream has been closed.The requested is not permitted by the operating system for the specified file handle, such as when is or and the file handle is set for read-only access.
Initializes a new instance of the class for the specified file handle, with the specified read/write permission and instance ownership.A file handle for the file that the current object will encapsulate.A bitwise combination of the enumeration values that sets the and properties of the object. if the file handle will be owned by this instance; otherwise, . is not a field of .The caller does not have the required permission.An I/O error, such as a disk error, occurred.
-or-
The stream has been closed.The requested is not permitted by the operating system for the specified file handle, such as when is or and the file handle is set for read-only access.
Initializes a new instance of the class for the specified file handle, with the specified read/write permission, instance ownership, and buffer size.A file handle for the file that this object will encapsulate.A bitwise combination of the enumeration values that sets the and properties of the object. if the file handle will be owned by this instance; otherwise, .A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. is negative.An I/O error, such as a disk error, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The requested is not permitted by the operating system for the specified file handle, such as when is or and the file handle is set for read-only access.
Initializes a new instance of the class for the specified file handle, with the specified read/write permission, instance ownership, buffer size, and synchronous or asynchronous state.A file handle for the file that this object will encapsulate.A bitwise combination of the enumeration values that sets the and properties of the object. if the file handle will be owned by this instance; otherwise, .A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. if the handle was opened asynchronously (that is, in overlapped I/O mode); otherwise, . is less than or greater than or is less than or equal to 0.The handle is invalid.An I/O error, such as a disk error, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The requested is not permitted by the operating system for the specified file handle, such as when is or and the file handle is set for read-only access.
Initializes a new instance of the class for the specified file handle, with the specified read/write permission.A file handle for the file that the current object will encapsulate.A bitwise combination of the enumeration values that sets the and properties of the object. is not a field of .The caller does not have the required permission.An I/O error, such as a disk error, occurred.
-or-
The stream has been closed.The requested is not permitted by the operating system for the specified file handle, such as when is or and the file handle is set for read-only access.
Initializes a new instance of the class for the specified file handle, with the specified read/write permission, and buffer size.A file handle for the file that the current object will encapsulate.A constant that sets the and properties of the object.A positive value greater than 0 indicating the buffer size. The default buffer size is 4096.The parameter is an invalid handle.
-or-
The parameter is a synchronous handle and it was used asynchronously.The parameter is negative.An I/O error, such as a disk error, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The requested is not permitted by the operating system for the specified file handle, such as when is or and the file handle is set for read-only access.
Initializes a new instance of the class for the specified file handle, with the specified read/write permission, buffer size, and synchronous or asynchronous state.A file handle for the file that this object will encapsulate.A bitwise combination of the enumeration values that sets the and properties of the object.A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. if the handle was opened asynchronously (that is, in overlapped I/O mode); otherwise, .The parameter is an invalid handle.
-or-
The parameter is a synchronous handle and it was used asynchronously.The parameter is negative.An I/O error, such as a disk error, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The requested is not permitted by the operating system for the specified file handle, such as when is or and the file handle is set for read-only access.
Initializes a new instance of the class with the specified path and creation mode.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. is .The caller does not have the required permission.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes. specifies a file that is read-only.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The specified path is invalid, such as being on an unmapped drive.The specified path, file name, or both exceed the system-defined maximum length. contains an invalid value.
Initializes a new instance of the class with the specified path, creation mode, and read/write permission.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file.A bitwise combination of the enumeration values that determines how the file can be accessed by the object. This also determines the values returned by the and properties of the object. is if specifies a disk file. is ..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The specified path is invalid, such as being on an unmapped drive.The requested is not permitted by the operating system for the specified , such as when is or and the file or directory is set for read-only access.The specified path, file name, or both exceed the system-defined maximum length. contains an invalid value.
Initializes a new instance of the class with the specified path, creation mode, read/write permission, and sharing permission.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file.A bitwise combination of the enumeration values that determines how the file can be accessed by the object. This also determines the values returned by the and properties of the object. is if specifies a disk file.A bitwise combination of the enumeration values that determines how the file will be shared by processes. is ..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The specified path is invalid, such as being on an unmapped drive.The requested is not permitted by the operating system for the specified , such as when is or and the file or directory is set for read-only access.The specified path, file name, or both exceed the system-defined maximum length. contains an invalid value.
Initializes a new instance of the class with the specified path, creation mode, read/write and sharing permission, and buffer size.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file.A bitwise combination of the enumeration values that determines how the file can be accessed by the object. This also determines the values returned by the and properties of the object. is if specifies a disk file.A bitwise combination of the enumeration values that determines how the file will be shared by processes.A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. is ..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. is negative or zero.
-or-
, , or contain an invalid value.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The specified path is invalid, such as being on an unmapped drive.The requested is not permitted by the operating system for the specified , such as when is or and the file or directory is set for read-only access.The specified path, file name, or both exceed the system-defined maximum length.
Initializes a new instance of the class with the specified path, creation mode, read/write and sharing permission, buffer size, and synchronous or asynchronous state.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file.A bitwise combination of the enumeration values that determines how the file can be accessed by the object. This also determines the values returned by the and properties of the object. is if specifies a disk file.A bitwise combination of the enumeration values that determines how the file will be shared by processes.A positive value greater than 0 indicating the buffer size. The default buffer size is 4096.Specifies whether to use asynchronous I/O or synchronous I/O. However, note that the underlying operating system might not support asynchronous I/O, so when specifying , the handle might be opened synchronously depending on the platform. When opened asynchronously, the and methods perform better on large reads or writes, but they might be much slower for small reads or writes. If the application is designed to take advantage of asynchronous I/O, set the parameter to . Using asynchronous I/O correctly can speed up applications by as much as a factor of 10, but using it without redesigning the application for asynchronous I/O can decrease performance by as much as a factor of 10. is ..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. is negative or zero.
-or-
, , or contain an invalid value.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The specified path is invalid, such as being on an unmapped drive.The requested is not permitted by the operating system for the specified , such as when is or and the file or directory is set for read-only access.The specified path, file name, or both exceed the system-defined maximum length.
Initializes a new instance of the class with the specified path, creation mode, read/write and sharing permission, the access other FileStreams can have to the same file, the buffer size, and additional file options.A relative or absolute path for the file that the current object will encapsulate.One of the enumeration values that determines how to open or create the file.A bitwise combination of the enumeration values that determines how the file can be accessed by the object. This also determines the values returned by the and properties of the object. is if specifies a disk file.A bitwise combination of the enumeration values that determines how the file will be shared by processes.A positive value greater than 0 indicating the buffer size. The default buffer size is 4096.A bitwise combination of the enumeration values that specifies additional file options. is ..NET Framework and .NET Core versions older than 2.1: is an empty string (""), contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. is negative or zero.
-or-
, , or contain an invalid value.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.The caller does not have the required permission.The specified path is invalid, such as being on an unmapped drive.The requested is not permitted by the operating system for the specified , such as when is or and the file or directory is set for read-only access.
-or-
is specified for , but file encryption is not supported on the current platform.The specified path, file name, or both exceed the system-defined maximum length.
Initializes a new instance of the class with the specified path, creation mode, read/write and sharing permission, buffer size, additional file options, preallocation size, and the access other FileStreams can have to the same file.A relative or absolute path for the file that the current instance will encapsulate.An object that describes optional parameters to use. or is . is an empty string, contains only white space, or contains one or more invalid characters.
-or-
refers to a non-file device, such as CON:, COM1:, or LPT1:, in an NTFS environment. refers to a non-file device, such as CON:, COM1:, LPT1:, etc. in a non-NTFS environment.The file cannot be found, such as when is or , and the file specified by does not exist. The file must already exist in these modes.An I/O error, such as specifying when the file specified by already exists, occurred.
-or-
The stream has been closed.
-or-
The disk was full (when was provided and was pointing to a regular file).
-or-
The file was too large (when was provided and was pointing to a regular file).The caller does not have the required permission.The specified path is invalid, such as being on an unmapped drive.The requested is not permitted by the operating system for the specified , such as when is or and the file or directory is set for read-only access.
-or-
is specified for , but file encryption is not supported on the current platform.The specified path, file name, or both exceed the system-defined maximum length.
Wraps the to the testable .
Abstraction of the file system.
Abstraction for static methods in .
A factory for the creation of wrappers for .
A factory for the creation of wrappers for .
Abstraction for static methods in .
A factory for the creation of wrappers for .
A factory for the creation of wrappers for .
A factory for the creation of wrappers for .
Abstraction for static methods and properties in .
Support ACL functionality on file system instances.
Gets a access control object that encapsulates the access control list (ACL) entries for the file or directory in the file system.
Gets a access control object that encapsulates the access control list (ACL) entries for the file or directory in the file system.
One of the values that specifies the type of access control list (ACL) information to receive.
Applies access control list (ACL) entries described by the object to the file or directory in the file system.
Specifies which sections of a security descriptor to save or load.
No sections.
The system access control list (SACL).
The discretionary access control list (DACL).
The owner.
The primary group.
The entire security descriptor.
Interface to support implementing extension methods on top of nested interfaces.
Exposes the underlying file system implementation.
This is useful for implementing extension methods.
Provides the base class for both and objects.
Exposes the underlying filesystem implementation. This is useful for implementing extension methods.
Gets or sets the attributes for the current file or directory.The specified file doesn't exist. Only thrown when setting the property value.The specified path is invalid. For example, it's on an unmapped drive. Only thrown when setting the property value.The caller doesn't have the required permission..NET Core and .NET 5+ only: The user attempts to set an attribute value but doesn't have write permission.The specified path, file name, or both exceed the system-defined maximum length.The caller attempts to set an invalid file attribute.
-or-
.NET Framework only: The user attempts to set an attribute value but doesn't have write permission. cannot initialize the data. of the current .
Gets or sets the creation time of the current file or directory. cannot initialize the data.The specified path is invalid; for example, it is on an unmapped drive.The current operating system is not Windows NT or later.The caller attempts to set an invalid creation time.The creation date and time of the current object.
Gets or sets the creation time, in coordinated universal time (UTC), of the current file or directory. cannot initialize the data.The specified path is invalid; for example, it is on an unmapped drive.The current operating system is not Windows NT or later.The caller attempts to set an invalid creation time.The creation date and time in UTC format of the current object.
Gets a value indicating whether the file or directory exists. if the file or directory exists; otherwise, .
Gets the extension part of the file name, including the leading dot . even if it is the entire file name, or an empty string if no extension is present.A string containing the extension.
Gets the full path of the directory or file.The fully qualified path and file name exceed the system-defined maximum length.The caller does not have the required permission.A string containing the full path.
Gets or sets the time the current file or directory was last accessed. cannot initialize the data.The current operating system is not Windows NT or later.The caller attempts to set an invalid access timeThe time that the current file or directory was last accessed.
Gets or sets the time, in coordinated universal time (UTC), that the current file or directory was last accessed. cannot initialize the data.The current operating system is not Windows NT or later.The caller attempts to set an invalid access time.The UTC time that the current file or directory was last accessed.
Gets or sets the time when the current file or directory was last written to. cannot initialize the data.The current operating system is not Windows NT or later.The caller attempts to set an invalid write time.The time the current file was last written.
Gets or sets the time, in coordinated universal time (UTC), when the current file or directory was last written to. cannot initialize the data.The current operating system is not Windows NT or later.The caller attempts to set an invalid write time.The UTC time when the current file was last written to.
Gets the target path of the link located in , or if this instance doesn't represent a link.The target path of the link located in , or if this instance doesn't represent a link.
For files, gets the name of the file. For directories, gets the name of the last directory in the hierarchy if a hierarchy exists. Otherwise, the property gets the name of the directory.A string that is the name of the parent directory, the name of the last directory in the hierarchy, or the name of a file, including the file name extension.
Gets or sets the Unix file mode for the current file or directory.The file mode is invalid.The caller does not have the required permission.The specified path exceeds the system-defined maximum length.The specified path is invalid. Only thrown when setting the property value.The specified file doesn't exist. Only thrown when setting the property value. cannot initialize the data. of the current .
Creates a symbolic link located in that points to the specified .The path of the symbolic link target. is . is empty.
-or-
contains invalid path characters.A file or directory already exists in the location of .
-or-
An I/O error occurred.
Deletes a file or directory.The specified path is invalid; for example, it is on an unmapped drive.There is an open handle on the file or directory, and the operating system is Windows XP or earlier. This open handle can result from enumerating directories and files. For more information, see How to: Enumerate Directories and Files.
Refreshes the state of the object.A device such as a disk drive is not ready.
Gets the target of the specified link. to follow links to the final target; to return the immediate next link.The file or directory does not exist.
-or-
There are too many levels of symbolic links.A instance if the link exists, independently if the target exists or not; if this file or directory is not a link.
Listens to the file system change notifications and raises events when a directory, or file in a directory, changes.
Gets the that contains the .The that contains the , if any, or if the is not encapsulated in an .
Gets or sets a value indicating whether the component is enabled.The object has been disposed.The current operating system is not Microsoft Windows NT or later.The directory specified in could not be found. has not been set or is invalid. if the component is enabled; otherwise, . The default is . If you are using the component on a designer in Visual Studio 2005, the default is .
Gets or sets the filter string used to determine what files are monitored in a directory.The filter string. The default is "*.*" (Watches all files.)
Gets the collection of all the filters used to determine what files are monitored in a directory.A filter collection.
Gets or sets a value indicating whether subdirectories within the specified path should be monitored. if you want to monitor subdirectories; otherwise, . The default is .
Gets or sets the size (in bytes) of the internal buffer.The internal buffer size in bytes. The default is 8192 (8 KB).
Gets or sets the type of changes to watch for.The value is not a valid bitwise OR combination of the values.The value that is being set is not valid.One of the values. The default is the bitwise OR combination of , , and .
Gets or sets the path of the directory to watch.The specified path does not exist or could not be found.
-or-
The specified path contains wildcard characters.
-or-
The specified path contains invalid path characters.The path to monitor. The default is an empty string ("").
Gets or sets an for the .An for the .
Gets or sets the object used to marshal the event handler calls issued as a result of a directory change.The that represents the object used to marshal the event handler calls issued as a result of a directory change. The default is .
Occurs when a file or directory in the specified is changed.
Occurs when a file or directory in the specified is created.
Occurs when a file or directory in the specified is deleted.
Occurs when the instance of is unable to continue monitoring changes or when the internal buffer overflows.
Occurs when a file or directory in the specified is renamed.
Begins the initialization of a used on a form or used by another component. The initialization occurs at run time.
Ends the initialization of a used on a form or used by another component. The initialization occurs at run time.
A synchronous method that returns a structure that contains specific information on the change that occurred, given the type of change you want to monitor.The to watch for.A that contains specific information on the change that occurred.
A synchronous method that returns a structure that contains specific information on the change that occurred, given the type of change you want to monitor and the time (in milliseconds) to wait before timing out.The to watch for.The time (in milliseconds) to wait before timing out.A that contains specific information on the change that occurred.
Synchronously returns a structure that contains specific information on the change that occurred, given the type of change to monitor.The to watch for.The amount of time to wait before timing out.A that contains specific information on the change that occurred.
A factory for the creation of wrappers for in a .
Initializes a new instance of a wrapper for which implements .
Initializes a new instance of a wrapper for which implements .
The directory to monitor, in standard or Universal Naming Convention (UNC) notation.
Initializes a new instance of a wrapper for which implements .
The directory to monitor, in standard or Universal Naming Convention (UNC) notation.
The type of files to watch. For example, "*.txt" watches for changes to all text files.
Initializes a new instance of a wrapper for which implements .
Initializes a new instance of a wrapper for which implements .
The directory to monitor, in standard or Universal Naming Convention (UNC) notation.
Initializes a new instance of a wrapper for which implements .
The directory to monitor, in standard or Universal Naming Convention (UNC) notation.
The type of files to watch.
For example, "*.txt" watches for changes to all text files.
Wraps the to the testable interface .
Performs operations on instances that contain file or directory path information. These operations are performed in a cross-platform manner.
Provides a platform-specific alternate character used to separate directory levels in a path string that reflects a hierarchical file system organization.
Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization.
A platform-specific separator character used to separate path strings in environment variables.
Provides a platform-specific volume separator character.
Changes the extension of a path string.The path information to modify.The new extension (with or without a leading period). Specify to remove an existing extension from ..NET Framework and .NET Core versions older than 2.1: contains one or more of the invalid characters defined in .The modified path information.
On Windows-based desktop platforms, if is or an empty string (""), the path information is returned unmodified. If is , the returned string contains the specified path with its extension removed. If has no extension, and is not , the returned path string contains appended to the end of .
Combines two strings into a path.The first path to combine.The second path to combine..NET Framework and .NET Core versions older than 2.1: or contains one or more of the invalid characters defined in . or is .The combined paths. If one of the specified paths is a zero-length string, this method returns the other path. If contains an absolute path, this method returns .
Combines three strings into a path.The first path to combine.The second path to combine.The third path to combine..NET Framework and .NET Core versions older than 2.1: , , or contains one or more of the invalid characters defined in ., , or is .The combined paths.
Combines four strings into a path.The first path to combine.The second path to combine.The third path to combine.The fourth path to combine..NET Framework and .NET Core versions older than 2.1: , , , or contains one or more of the invalid characters defined in ., , , or is .The combined paths.
Combines an array of strings into a path.An array of parts of the path..NET Framework and .NET Core versions older than 2.1: One of the strings in the array contains one or more of the invalid characters defined in .One of the strings in the array is .The combined paths.
Returns a value that indicates whether the path, specified as a read-only span, ends in a directory separator.The path to analyze. if the path ends in a directory separator; otherwise, .
Returns a value that indicates whether the specified path ends in a directory separator.The path to analyze. if the path ends in a directory separator; otherwise, .
Determines whether the specified file or directory exists.The path to check if the caller has the required permissions and contains the name of an existing file or directory; otherwise, .
This method also returns if is , an invalid path, or a zero-length string. If the caller does not have sufficient permissions to read the specified path, no exception is thrown and the method returns regardless of the existence of .
Returns the directory information for the specified path represented by a character span.The path to retrieve the directory information from.Directory information for , or an empty span if is , an empty span, or a root (such as \, C:, or \\server\share).
Returns the directory information for the specified path.The path of a file or directory..NET Framework and .NET Core versions older than 2.1: The parameter contains invalid characters, is empty, or contains only white spaces.The parameter is longer than the system-defined maximum length.
Note: In .NET for Windows Store apps or the Portable Class Library, catch the base class exception, , instead.Directory information for , or if denotes a root directory or is null. Returns if does not contain directory information.
Returns the extension of a file path that is represented by a read-only character span.The file path from which to get the extension.The extension of the specified path (including the period, "."), or if does not have extension information.
Returns the extension (including the period ".") of the specified path string.The path string from which to get the extension..NET Framework and .NET Core versions older than 2.1: contains one or more of the invalid characters defined in .The extension of the specified path (including the period "."), or , or . If is , returns . If does not have extension information, returns .
Returns the file name and extension of a file path that is represented by a read-only character span.A read-only span that contains the path from which to obtain the file name and extension.The characters after the last directory separator character in .
Returns the file name and extension of the specified path string.The path string from which to obtain the file name and extension..NET Framework and .NET Core versions older than 2.1: contains one or more of the invalid characters defined in .The characters after the last directory separator character in . If the last character of is a directory or volume separator character, this method returns . If is , this method returns .
Returns the file name without the extension of a file path that is represented by a read-only character span.A read-only span that contains the path from which to obtain the file name without the extension.The characters in the read-only span returned by , minus the last period (.) and all characters following it.
Returns the file name of the specified path string without the extension.The path of the file..NET Framework and .NET Core versions older than 2.1: contains one or more of the invalid characters defined in .The string returned by , minus the last period (.) and all characters following it.
Returns the absolute path for the specified path string.The file or directory for which to obtain absolute path information. is a zero-length string, contains only white space on Windows systems, or contains one or more of the invalid characters defined in .
-or-
The system could not retrieve the absolute path.The caller does not have the required permissions. is .
.NET Framework only: contains a colon (":") that is not part of a volume identifier (for example, "c:\").The specified path, file name, or both exceed the system-defined maximum length.The fully qualified location of , such as "C:\MyFile.txt".
Returns an absolute path from a relative path and a fully qualified base path.A relative path to concatenate to .The beginning of a fully qualified path. or is . is not a fully qualified path.
-or-
or contains one or more of the invalid characters defined in .The absolute path.
Gets an array containing the characters that are not allowed in file names.An array containing the characters that are not allowed in file names.
Gets an array containing the characters that are not allowed in path names.An array containing the characters that are not allowed in path names.
Gets the root directory information from the path contained in the specified character span.A read-only span of characters containing the path from which to obtain root directory information.A read-only span of characters containing the root directory of .
Gets the root directory information from the path contained in the specified string.A string containing the path from which to obtain root directory information..NET Framework and .NET Core versions older than 2.1: contains one or more of the invalid characters defined in .
-or-
.NET Framework only: was passed to .The root directory of if it is rooted.
-or-
if does not contain root directory information.
-or-
if is or is effectively empty.
Returns a random folder name or file name.A random folder name or file name.
Returns a relative path from one path to another.The source path the result should be relative to. This path is always considered to be a directory.The destination path. or is . or is effectively empty.The relative path, or if the paths don't share the same root.
Creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file.An I/O error occurs, such as no unique temporary file name is available.
-or-
This method was unable to create a temporary file.The full path of the temporary file.
Returns the path of the current user's temporary folder.The caller does not have the required permissions.The path to the temporary folder, ending with a .
Determines whether the path represented by the specified character span includes a file name extension.The path to search for an extension. if the characters that follow the last directory separator character or volume separator in the path include a period (".") followed by one or more characters; otherwise, .
Determines whether a path includes a file name extension.The path to search for an extension..NET Framework and .NET Core versions older than 2.1: contains one or more of the invalid characters defined in . if the characters that follow the last directory separator (\ or /) or volume separator (:) in the path include a period (.) followed by one or more characters; otherwise, .
Returns a value that indicates whether the file path represented by the specified character span is fixed to a specific drive or UNC path.A file path. if the path is fixed to a specific drive or UNC path; if the path is relative to the current drive or working directory.
Returns a value that indicates whether the specified file path is fixed to a specific drive or UNC path.A file path. is . if the path is fixed to a specific drive or UNC path; if the path is relative to the current drive or working directory.
Returns a value that indicates whether the specified character span that represents a file path contains a root.The path to test. if contains a root; otherwise, .
Returns a value indicating whether the specified path string contains a root.The path to test..NET Framework and .NET Core versions older than 2.1: contains one or more of the invalid characters defined in . if contains a root; otherwise, .
Concatenates two path components into a single path.A character span that contains the first path to join.A character span that contains the second path to join.The combined paths.
Concatenates three path components into a single path.A character span that contains the first path to join.A character span that contains the second path to join.A character span that contains the third path to join.The concatenated path.
Attempts to concatenate two path components to a single preallocated character span, and returns a value that indicates whether the operation succeeded.A character span that contains the first path to join.A character span that contains the second path to join.A character span to hold the concatenated path.When the method returns, a value that indicates the number of characters written to the . if the concatenation operation is successful; otherwise, .
Attempts to concatenate three path components to a single preallocated character span, and returns a value that indicates whether the operation succeeded.A character span that contains the first path to join.A character span that contains the second path to join.A character span that contains the third path to join.A character span to hold the concatenated path.When the method returns, a value that indicates the number of characters written to the . if the concatenation operation is successful; otherwise, .
Concatenates two paths into a single path.The first path to join.The second path to join.The concatenated path.
Concatenates three paths into a single path.The first path to join.The second path to join.The third path to join.The concatenated path.
Concatenates an array of paths into a single path.An array of paths.The concatenated path.
Trims one trailing directory separator beyond the root of the specified path.The path to trim.The without any trailing directory separators.
Trims one trailing directory separator beyond the root of the specified path.The path to trim.The without any trailing directory separators.
Concatenates four path components into a single path.A character span that contains the first path to join.A character span that contains the second path to join.A character span that contains the third path to join.A character span that contains the fourth path to join.The concatenated path.
Concatenates four paths into a single path.The first path to join.The second path to join.The third path to join.The fourth path to join.The concatenated path.
Abstractions for .
Gets or sets the type of change that occurred.One of the values.
Gets or sets the name of the file or directory that changed.The name of the file or directory that changed.
Gets or sets the original name of the file or directory that was renamed.The original name of the file or directory that was renamed.
Gets or sets a value indicating whether the wait operation timed out. if the method timed out; otherwise, .