Indicates how to open a file when calling file-access functions.
public enum class OpenMode
public enum OpenMode
type OpenMode =
Public Enum OpenMode
File opened to append to it. Default.
File opened for binary access.
File opened for read access.
File opened for write access.
File opened for random access.
When you call file access-related functions, you can use enumeration members in your code instead of the actual values.
OpenMode enumeration defines constants used to set file access modes. The following table lists the
OpenMode enumeration members.
Append are used when sequentially accessing files, such as text files, whereas
Binary is used for binary file access and
Random for random file access. For examples, see the FileOpen method.
When sequentially accessing a file, you cannot change its data. You can read the data, append to it, or overwrite it with new data. If you open it for input, the contents of the file will be overwritten, even if you do not directly write to the file.
When performing file I/O operations, the
My.Computer.FileSystem object provides better performance and ease of use than earlier file I/O methods. For more information, see FileSystem object.