File Commands

The following functions can be used to manipulate files, standard I/O and disk services:

CHDIR

Change the current (default) directory on a given drive.

CHDRIVE

Change the current default drive.

CLOSE

Conclude I/O (input/output) to/from a file or device.

CURDIR$

Return the current directory for a given drive.

DIR$

Return a filename that matches the given mask.

DIR$ CLOSE

Force the release the operating system FindNext handle.

DISKFREE

Return the amount of available space of a disk, in bytes.

DISKSIZE

Return the total amount of space on a disk, in bytes.

EOF

Return end-of-file status of a file, serial or TCP/UDP transmission.

EXE

Return the path and/or name of the executing program.

FIELD

Bind a field string variable to a particular sub-section of a random file buffer or a dynamic string variable.

FIELD RESET

Reset the FIELD string to a nul (zero-length) dynamic string.

FIELD STRING

Change the FILED string to a dynamic string, but first assigns the current sub-section data to it.

FILEATTR

Return information about an open file.

FILECOPY

Copy a file.

FILENAME$

Return the file-system name of an open file.

FILESCAN

Rapidly scan a INPUT or BINARY file to obtain string size info.

FLUSH

Flush file buffers to disk to ensure the disk information is current.

FREEFILE

Return the next available PowerBASIC file number.

GET

Read a record from a random-access file.

GET$

Reads an ANSI string from a file opened in binary mode.

GET$$

Reads WIDE string data from a file opened in binary mode.

GETATTR

Return the file-system attribute(s) of a disk file or directory.

INPUT#

Load variables with data from a sequential file.

ISFILE

Determine whether or not a file exists.

ISFOLDER

Determine whether or not a folder exists.

KILL

Delete a disk file.

LINE INPUT#

Read line(s) from a sequential file into a string variable or array.

LOC

Determine the current seek position in an open disk file.

LOCK

Lock part or all of an open file for exclusive access.

LOF

Return the length of an open disk file.

MKDIR

Create a subdirectory/folder (like the DOS MKDIR command).

NAME

Rename a file or a directory (like the DOS REN command).

OPEN

Prepare a file or device for reading or writing.

PATHNAME$

Parse a path/file name to extract component parts.

PATHSCAN$

Find a file on disk and return the path and/or file name parts.

PRINT#

Write data to a device or sequential file.

PROFILE

Create a file containing the time profile of Subs, Functions, Methods, and Properties.

PUT

Write a record to a random-access file or variable to a binary file.

PUT$

Writes an ANSI string to a file opened in binary mode.

PUT$$

Writes a WIDE Unicode string to a file opened in binary mode.

RMDIR

Delete a disk directory (like the DOS RMDIR command).

SEEK

File location where the next I/O operation will take place.

SEEK

Set the position in a file for the next input or output operation.

SETATTR

Set the file system attribute(s) of a disk file or directory.

SETEOF

Truncate/extend a file to its current file pointer position.

SHELL

Run an executable program asynchronously.

SHELL

Run an executable program synchronously.

UNLOCK

Remove exclusive-access locks placed on a file.

WRITE#

Output data to a sequential file in a delimited format.