O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

FileOpen Procedure

Class

Microsoft.VisualBasic.FileSystem

Syntax

FileOpen(filenumber, filename, mode, access, share, recordlength)
filenumber (required; Integer)

An available file number.

filename (required; String)

The name of the file to open, along with an optional path.

mode (optional; OpenMode enum)

The file-access mode. Options are: OpenMode.Append, OpenMode. Binary, OpenMode.Input, OpenMode.Output, or OpenMode.Random (the default value).

access (optional; OpenAccess enum)

Specifies the allowable operations by the current process. Options are: OpenAccess.Default, OpenAccess.Read, OpenAccess.ReadWrite (the default value), or OpenAccess.Write.

share (optional; OpenShare enum)

Specifies the allowable operations by other processes. Options are: OpenShare.Shared (the default value), OpenShare.LockRead, OpenShare. LockWrite, or OpenShare.LockreadWrite.

recordlength (optional; 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 access. Random access is designed to be used with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required