McBasic™Get McBasic™ ↗
Build 881
Runtime API

File and Path

File operations use strict UTF-8 or byte arrays. Output directories must exist; the application bundle is read-only.

Read the task-based guide before using an isolated signature. Arguments are positional unless a signature explicitly marks an optional argument.

File.ReadText#

Read strict UTF-8 text; invalid encoding is an error.

BASIC-facing contract
Function ReadText(path As String) As String

File.WriteText#

Replace the intended file contents. This is not an append operation.

BASIC-facing contract
Sub WriteText(path As String, text As String)

File.AppendText#

Append UTF-8 text. Supply a newline yourself if required.

BASIC-facing contract
Sub AppendText(path As String, text As String)

File.ReadBytes#

Read a binary file as a zero-based byte array.

BASIC-facing contract
Function ReadBytes(path As String) As Byte()

File.WriteBytes#

Write an allocated one-dimensional Byte array.

BASIC-facing contract
Sub WriteBytes(path As String, ByRef data() As Byte)

File.Exists#

Check the path; a later operation may still fail if it changes.

BASIC-facing contract
Function Exists(path As String) As Boolean

File.Delete#

Delete only a deliberately selected file. Missing files are reported as an error.

BASIC-facing contract
Sub Delete(path As String)

Path.Combine#

Combine path parts without executing a shell.

BASIC-facing contract
Function Combine(left As String, right As String) As String

Path names#

Inspect path structure without reading the file.

BASIC-facing contract
Function GetFileName(path As String) As String
Function GetDirectoryName(path As String) As String
Function GetExtension(path As String) As String
Function GetFileNameWithoutExtension(path As String) As String

Path normalization#

Transform or inspect paths; this does not grant file access.

BASIC-facing contract
Function ChangeExtension(path As String, extension As String) As String
Function GetFullPath(path As String) As String
Function IsAbsolute(path As String) As Boolean
Source baseline 20f4bfed6b · Build manifest