System::IO::File class
Contents
[
Hide
]File class
Provides methods for manipulating files. This is a static type with no instance services. You should never create instances of it by any means.
class File
Methods
| Method | Description |
|---|---|
| static AppendAllLines(const String&, const SharedPtr<Collections::Generic::IEnumerable<String>>&, const EncodingPtr&) | Appends strings from the specified collection of strings to the specified file using the specified encoding by writing each string in a new line. If the specified file does not exist, it is created. The file is closed after writing all strings. |
| static AppendAllText(const String&, const String&, const EncodingPtr&) | Appends the specified string to the specified file using the specified encoding. |
| static AppendText(const String&) | Creates a StreamWriter object that appends text to the specified file using UTF-8 encoding. If the specified file does not exist, it is created. |
| static Copy(const String&, const String&, bool) | Copies the specified file to the specified location. If the destination file already exists, a parameter specifies if it should be overwritten. |
| static Create(const String&, int32_t, FileOptions) | Creates a new file (or overwrites existing) and opens it for reading and writing access using the specified buffer size and options. |
| static CreateText(const String&) | Creates a new or opens existing file for writing UTF-8 encoded text. |
| static Decrypt(const String&) | NOT IMPLEMENTED. |
| static Delete(const String&) | Deletes the specified file or directory. |
| static Encrypt(const String&) | NOT IMPLEMENTED. |
| static Exists(const String&) | Determines if the specified path references an existing file. |
| static GetAttributes(const String&) | Returns the attributes of the specified entity. |
| static GetCreationTime(const String&) | Returns the creation time of the specified entity as local time. |
| static GetCreationTimeUtc(const String&) | Returns the creation time of the specified entity as UTC time. |
| static GetLastAccessTime(const String&) | Returns the last access time of the specified entity as local time. |
| static GetLastAccessTimeUtc(const String&) | Returns the last access time of the specified entity as UTC time. |
| static GetLastWriteTime(const String&) | Returns the last write time of the specified entity as local time. |
| static GetLastWriteTimeUtc(const String&) | Returns the last write time of the specified entity as UTC time. |
| static Move(const String&, const String&) | Moves the specified file to the new location. |
| static Open(const String&, FileMode) | Opens the specified file in the specified mode for reading and writing and with no sharing. |
| static Open(const String&, FileMode, FileAccess, FileShare) | Opens the specified file in the specified mode, with the specified access type and sharing option. |
| static OpenRead(const String&) | Opens the specified file for reading only, in ‘Open’ mode with shared access for reading. |
| static OpenText(const String&, const EncodingPtr&) | Opens the specified existing file for reading text using UTF-8 encoding with no sharing. |
| static OpenWrite(const String&) | Opens the specified file for writing only, in ‘OpenOrCreate’ mode with no sharing. |
| static ReadAllBytes(const String&) | Reads the content of the specified binary file to a byte array. |
| static ReadAllLines(const String&, const EncodingPtr&) | Reads the content of the specified text file line by line to an array of strings using the specified character encoding. |
| static ReadAllText(const String&, const EncodingPtr&) | Reads the content of the specified text file to a single String object using the specified character encoding. |
| static ReadLines(const String&, const EncodingPtr&) | Reads the content of the specified text file line by line using the specified character encoding and returns enumerable collection of strings each of which represents a single line of the file’s content. |
| static Replace(const String&, const String&, const String&, bool) | Replaces the contents of a one file with another and creates a backup of the replaced file. |
| static SetAttributes(const String&, FileAttributes) | Sets the specified attributes on the specified file. |
| static SetCreationTime(const String&, DateTime) | NOT IMPLEMENTED. |
| static SetCreationTimeUtc(const String&, DateTime) | NOT IMPLEMENTED. |
| static SetLastAccessTime(const String&, DateTime) | NOT IMPLEMENTED. |
| static SetLastAccessTimeUtc(const String&, DateTime) | NOT IMPLEMENTED. |
| static SetLastWriteTime(const String&, DateTime) | Sets the last write time of the specified entity as local time. |
| static SetLastWriteTimeUtc(const String&, DateTime) | Sets the last write time of the specified entity as UTC time. |
| static WriteAllBytes(const String&, const ArrayPtr<uint8_t>&) | Overwrites the specified binary file and writes the specified bytes to it. |
| static WriteAllLines(const String&, const SharedPtr<Collections::Generic::IEnumerable<String>>&, const EncodingPtr&) | Creates a new text file or overwrites the existing one and writes all strings from the specified enumerable collection of strings to it, each string on a new line, using the specified encoding. |
| static WriteAllLines(const String&, const ArrayPtr<String>&, const EncodingPtr&) | Creates a new text file or overwrites the existing one and writes all strings from the specified array of strings to it, each string on a new line, using the specified encoding. |
| static WriteAllText(const String&, const String&, const EncodingPtr&) | Creates a new text file or overwrites the existing one and writes the content of the specified string to it using the specified encoding. |
Fields
| Field | Description |
|---|---|
| static DefaultBufferSize | Default value of the number of bytes buffered during reading from and writing to a file. |
See Also
- Namespace System::IO
- Library Aspose.PUB for C++