Name
FileOpen Procedure
Class
Microsoft.VisualBasic.FileSystem
Syntax
FileOpen(filenumber, filename, mode, access, share, recordlength)-
filenumber Use: Required
Data Type: Integer
An available file number.
-
filename Use: Required
Data Type: String
The name of the file to open, along with an optional path.
-
mode Use: Optional
Data Type:
OpenModeenumThe file-access mode. Options are:
OpenMode.Append,OpenMode.Binary,OpenMode.Input,OpenMode.Output, orOpenMode.Random(the default value).-
access Use: Optional
Data Type:
OpenAccessenumSpecifies the allowable operations by the current process. Options are:
OpenAccess.Default,OpenAccess.Read,OpenAccess.ReadWrite(the default value), orOpenAccess.Write.-
share Use: Optional
Type:
OpenShareenumSpecifies the allowable operations by other processes. Options are:
OpenShare.Shared(the default value),OpenShare.LockRead,OpenShare.LockWrite, orOpenShare.LockreadWrite.-
recordlength Use: Optional
Data Type: Integer (at most, 32767)
The length of the record (for random access) or of the I/O buffer (for sequential access).
Description
Opens a disk file for reading and/or writing
Rules at a Glance
There are three modes of file access: sequential, binary, and random. The Input, Output, and Append access modes are sequential access modes. Sequential access is designed for text files consisting of individual Unicode characters (and control codes). Most of the file-manipulation functions (
LineInput,Print,PrintLine, and so on) apply to files opened for sequential ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access