# addDirectory
function addDirectory(system, directory)Add state for add directory.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `addDirectory`. |
directory | dynamic | — | The directory input consumed by `addDirectory`. |
src/miniquake/filesystem.mlminiquake/array_util.ml as arrayutil → src/miniquake/array_util.mlminiquake/byteio.ml as bio → src/miniquake/byteio.mlminiquake/common.ml as common → src/miniquake/common.mlminiquake/memory.ml as memory → src/miniquake/memory.mlminiquake/pak.ml as pak → src/miniquake/pak.mlminiquake/protocol_text.ml as quakeText → src/miniquake/protocol_text.mlminiquake/types.ml as t → src/miniquake/types.mlstd/fs.ml as fs → ../MiniLangCompilerOptimization/MiniLangCompilerPy/std/fs.ml external dependencyfunction addDirectory(system, directory)Add state for add directory.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `addDirectory`. |
directory | dynamic | — | The directory input consumed by `addDirectory`. |
function addGameDirectory(system, directory)Add state for add game directory.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `addGameDirectory`. |
directory | dynamic | — | The directory input consumed by `addGameDirectory`. |
function addPack(system, filename)Add state for add pack.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `addPack`. |
filename | dynamic | — | Path of the file to process. |
function cachedLocation(system, netPath)Return cached location derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `cachedLocation`. |
netPath | dynamic | — | Filesystem path used by the operation. |
function cachePath(system, netPath)Return cache path derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `cachePath`. |
netPath | dynamic | — | Filesystem path used by the operation. |
function checkRegistered(system)Validate registered and report any incompatibility.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `checkRegistered`. |
function closeFile(handle)Release state for close file.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle | dynamic | — | The handle input consumed by `closeFile`. |
function COM_AddGameDirectory(system, directory)Mirror Quake's COM_AddGameDirectory routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_AddGameDirectory`. |
directory | dynamic | — | The directory input consumed by `COM_AddGameDirectory`. |
function COM_CheckRegistered(system)Original WinQuake/common.c filesystem entry points. The state that was global in C is explicit in MiniLang, but the observable operations are the same and remain independently differential-testable.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_CheckRegistered`. |
function COM_CloseFile(handle)Mirror Quake's COM_CloseFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle | dynamic | — | The handle input consumed by `COM_CloseFile`. |
function COM_CopyFile(netPath, cachePath)Mirror Quake's COM_CopyFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
netPath | dynamic | — | Filesystem path used by the operation. |
cachePath | dynamic | — | Filesystem path used by the operation. |
function COM_CreatePath(path)Mirror Quake's COM_CreatePath routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | dynamic | — | Filesystem path to process. |
function COM_FindFile(system, filename)Mirror Quake's COM_FindFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_FindFile`. |
filename | dynamic | — | Path of the file to process. |
function COM_FOpenFile(system, filename)Mirror Quake's COM_FOpenFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_FOpenFile`. |
filename | dynamic | — | Path of the file to process. |
function COM_InitFilesystem(suppliedBaseDirectory, commandLine)Mirror Quake's COM_InitFilesystem routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
suppliedBaseDirectory | dynamic | — | The supplied base directory input consumed by `COM_InitFilesystem`. |
commandLine | dynamic | — | The command line input consumed by `COM_InitFilesystem`. |
function COM_LoadCacheFile(system, path)Mirror Quake's COM_LoadCacheFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_LoadCacheFile`. |
path | dynamic | — | Filesystem path to process. |
function COM_LoadFile(system, path)Mirror Quake's COM_LoadFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_LoadFile`. |
path | dynamic | — | Filesystem path to process. |
function COM_LoadHunkFile(system, path)Mirror Quake's COM_LoadHunkFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_LoadHunkFile`. |
path | dynamic | — | Filesystem path to process. |
function COM_LoadPackFile(filename)Mirror Quake's COM_LoadPackFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
filename | dynamic | — | Path of the file to process. |
function COM_LoadStackFile(system, path, buffer)Mirror Quake's COM_LoadStackFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_LoadStackFile`. |
path | dynamic | — | Filesystem path to process. |
buffer | dynamic | — | The buffer input consumed by `COM_LoadStackFile`. |
function COM_LoadTempFile(system, path)Mirror Quake's COM_LoadTempFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_LoadTempFile`. |
path | dynamic | — | Filesystem path to process. |
function COM_OpenFile(system, filename)Mirror Quake's COM_OpenFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_OpenFile`. |
filename | dynamic | — | Path of the file to process. |
function COM_Path_f(system)Mirror Quake's COM_Path_f routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_Path_f`. |
function COM_WriteFile(system, filename, data)Mirror Quake's COM_WriteFile routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `COM_WriteFile`. |
filename | dynamic | — | Path of the file to process. |
data | dynamic | — | Input data consumed by the operation. |
function containsDirectorySeparator(name)Implements the `containsDirectorySeparator` operation for `miniquake.filesystem` (contains directory separator).
| Parameter | Type | Default | Description |
|---|---|---|---|
name | dynamic | — | Stable name that identifies the requested object or option. |
function copyFile(netPath, destination)Transfer data for copy file.
| Parameter | Type | Default | Description |
|---|---|---|---|
netPath | dynamic | — | Filesystem path used by the operation. |
destination | dynamic | — | Destination value or collection to update. |
function copyTerminated(destination, source)Transfer data for copy terminated.
| Parameter | Type | Default | Description |
|---|---|---|---|
destination | dynamic | — | Destination value or collection to update. |
source | dynamic | — | Source value or collection to read. |
function create(baseDirectory, gameDirectory)Implements the `create` operation for `miniquake.filesystem` (create).
| Parameter | Type | Default | Description |
|---|---|---|---|
baseDirectory | dynamic | — | Root directory containing the Quake installation. |
gameDirectory | dynamic | — | Selected Quake game-data directory. |
function createDirectory(path)Create one directory component on the active host platform and report whether it exists after the operation.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | dynamic | — | Filesystem path to create. |
extern function CreateDirectoryW(path as wstr, security as ptr) from "kernel32.dll" returns boolCreate a directory through the Win32 wide-character filesystem API.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | wstr | — | Filesystem path to create. |
security | ptr | — | Optional Win32 security attributes pointer. |
Returns: True when Windows creates the directory.
function createPath(path)Create and initialize path.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | dynamic | — | Filesystem path to process. |
function describe(system)Implements the `describe` operation for `miniquake.filesystem` (describe).
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `describe`. |
function exists(system, name)Report whether exists holds for the active state.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `exists`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function fileExists(system, name)Report whether file exists holds for the active state.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `fileExists`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function fileTime(path)Implements the `fileTime` operation for `miniquake.filesystem` (file time).
| Parameter | Type | Default | Description |
|---|---|---|---|
path | dynamic | — | Filesystem path to process. |
function findFile(system, name)Return file.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `findFile`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function findLocation(system, name)Return location.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `findLocation`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function fOpenFile(system, name)Implements the `fOpenFile` operation for `miniquake.filesystem` (f open file).
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `fOpenFile`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function gamePath(system, name)Return game path derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `gamePath`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
extern function GetFileAttributesExW(path as wstr, infoLevel as i32, data as bytes) from "kernel32.dll" returns boolRead file metadata through the Win32 wide-character filesystem API.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | wstr | — | Filesystem path to inspect. |
infoLevel | i32 | — | Win32 attribute-information level. |
data | bytes | — | Caller-owned output buffer for the attribute record. |
Returns: True when Windows reads the metadata successfully.
function handleRead(handle, count)Handle read and update the associated state.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle | dynamic | — | The handle input consumed by `handleRead`. |
count | dynamic | — | Number of entries or units to process. |
function handleSeek(handle, position)Handle seek and update the associated state.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle | dynamic | — | The handle input consumed by `handleSeek`. |
position | dynamic | — | Position used by the operation. |
function initFilesystem(suppliedBaseDirectory, commandLine)Initialize state for init filesystem.
| Parameter | Type | Default | Description |
|---|---|---|---|
suppliedBaseDirectory | dynamic | — | The supplied base directory input consumed by `initFilesystem`. |
commandLine | dynamic | — | The command line input consumed by `initFilesystem`. |
function initialize(baseDirectory, gameName)Initializes ialize for `miniquake.filesystem`.
| Parameter | Type | Default | Description |
|---|---|---|---|
baseDirectory | dynamic | — | Root directory containing the Quake installation. |
gameName | dynamic | — | Name that identifies the requested value or resource. |
function initializeArguments(suppliedBaseDirectory, commandLine)Initialize state for initialize arguments.
| Parameter | Type | Default | Description |
|---|---|---|---|
suppliedBaseDirectory | dynamic | — | The supplied base directory input consumed by `initializeArguments`. |
commandLine | dynamic | — | The command line input consumed by `initializeArguments`. |
function isModified(system)Report whether is modified.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `isModified`. |
function join(a, b)Implements the `join` operation for `miniquake.filesystem` (join).
| Parameter | Type | Default | Description |
|---|---|---|---|
a | dynamic | — | The a input consumed by `join`. |
b | dynamic | — | The b input consumed by `join`. |
function loadCacheAllocation(system, memoryState, name)Read and validate cache allocation.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `loadCacheAllocation`. |
memoryState | dynamic | — | Mutable state used by `loadCacheAllocation`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function loadCacheFile(system, name)Read and validate cache file.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `loadCacheFile`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function loadFile(system, name)COM_LoadFile always allocated one extra byte and NUL-terminated it. Keep readFile as the raw COM_FindFile view used by binary parsers, and expose the load-family behavior explicitly.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `loadFile`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function loadHunkAllocation(system, memoryState, name)Read and validate hunk allocation.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `loadHunkAllocation`. |
memoryState | dynamic | — | Mutable state used by `loadHunkAllocation`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function loadHunkFile(system, name)Read and validate hunk file.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `loadHunkFile`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function loadPackFile(filename)Read and validate pack file.
| Parameter | Type | Default | Description |
|---|---|---|---|
filename | dynamic | — | Path of the file to process. |
function loadStackAllocation(system, memoryState, name, buffer)Read and validate stack allocation.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `loadStackAllocation`. |
memoryState | dynamic | — | Mutable state used by `loadStackAllocation`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
buffer | dynamic | — | The buffer input consumed by `loadStackAllocation`. |
function loadStackFile(system, name, buffer)Read and validate stack file.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `loadStackFile`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
buffer | dynamic | — | The buffer input consumed by `loadStackFile`. |
function loadTempAllocation(system, memoryState, name)Read and validate temp allocation.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `loadTempAllocation`. |
memoryState | dynamic | — | Mutable state used by `loadTempAllocation`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function loadTempFile(system, name)Read and validate temp file.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `loadTempFile`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function loadZoneAllocation(system, memoryState, name)Read and validate zone allocation.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `loadZoneAllocation`. |
memoryState | dynamic | — | Mutable state used by `loadZoneAllocation`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function musicTrackName(track)Return music track name derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
track | dynamic | — | The track input consumed by `musicTrackName`. |
function musicTrackPath(system, track)Return music track path derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `musicTrackPath`. |
track | dynamic | — | The track input consumed by `musicTrackPath`. |
function normalizeName(name)Convert name into its canonical representation.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | dynamic | — | Stable name that identifies the requested object or option. |
function openFile(system, name)Initialize state for open file.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `openFile`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function packFileCount(system)Return pack file count derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `packFileCount`. |
function pathCommandText(system)Return path command text for the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `pathCommandText`. |
function readFile(system, name)Read and validate file.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `readFile`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function readLooseMusicTrack(directory, filename)Read and validate loose music track.
| Parameter | Type | Default | Description |
|---|---|---|---|
directory | dynamic | — | The directory input consumed by `readLooseMusicTrack`. |
filename | dynamic | — | Path of the file to process. |
function readMusicTrack(system, track)Read and validate music track.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `readMusicTrack`. |
track | dynamic | — | The track input consumed by `readMusicTrack`. |
function readText(system, name)Reads text for `miniquake.filesystem`.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `readText`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function registeredWords()Registers ed words for `miniquake.filesystem`.
function release(system)Release or remove state for the requested value.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `release`. |
function rereleaseMusicDirectory(system, gameDirectory)Implements the `rereleaseMusicDirectory` operation for `miniquake.filesystem` (rerelease music directory).
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `rereleaseMusicDirectory`. |
gameDirectory | dynamic | — | Selected Quake game-data directory. |
function resolve(system, name)Implements the `resolve` operation for `miniquake.filesystem` (resolve).
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `resolve`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function searchPathSummary(system)Return search path summary derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `searchPathSummary`. |
function standard(baseDirectory, gameName)Implements the `standard` operation for `miniquake.filesystem` (standard).
| Parameter | Type | Default | Description |
|---|---|---|---|
baseDirectory | dynamic | — | Root directory containing the Quake installation. |
gameName | dynamic | — | Name that identifies the requested value or resource. |
function trimTrailingSeparator(path)Implements the `trimTrailingSeparator` operation for `miniquake.filesystem` (trim trailing separator).
| Parameter | Type | Default | Description |
|---|---|---|---|
path | dynamic | — | Filesystem path to process. |
function writeBytes(system, name, data)Writes bytes for `miniquake.filesystem`.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `writeBytes`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
data | dynamic | — | Input data consumed by the operation. |
function writeFile(system, name, data)Encode and write file.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `writeFile`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
data | dynamic | — | Input data consumed by the operation. |
function writeText(system, name, text)Writes text for `miniquake.filesystem`.
| Parameter | Type | Default | Description |
|---|---|---|---|
system | dynamic | — | The system input consumed by `writeText`. |
name | dynamic | — | Stable name that identifies the requested object or option. |
text | dynamic | — | Text to parse or process. |