Provides minisql platform file linux facilities for this project.
Package: minisql.platform.file_linux
Reachable from entry: no
std/io/file.mlasportable→../MiniLangCompilerML/std/io/file.ml— external dependency
function closeNative(handle)Closes the portable descriptor after its caller has released any lock.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle |
dynamic |
— | Native or runtime handle used by the operation. |
function componentName()Returns the stable diagnostic name used by the module catalog.
function convert(result, operation)Converts a portable file result to MiniSQL's stable storage error codes.
| Parameter | Type | Default | Description |
|---|---|---|---|
result |
dynamic |
— | Result object populated or inspected by the operation. |
operation |
dynamic |
— | operation value consumed by this operation. |
const CREATE_ALWAYS = 2Defines the create always constant used by the minisql platform file linux module.
const CREATE_NEW = 1Defines the create new constant used by the minisql platform file linux module.
function createDirectory(path)Creates one directory and retains the failing path in diagnostic errors.
| Parameter | Type | Default | Description |
|---|---|---|---|
path |
dynamic |
— | Path of the file or directory used by the operation. |
function deletePath(path)Deletes one file-system path.
| Parameter | Type | Default | Description |
|---|---|---|---|
path |
dynamic |
— | Path of the file or directory used by the operation. |
function directoryExists(path)Reports whether a directory exists at the path.
| Parameter | Type | Default | Description |
|---|---|---|---|
path |
dynamic |
— | Path of the file or directory used by the operation. |
function fail(code, operation, message)Creates a MiniSQL platform error with consistent Linux component context.
| Parameter | Type | Default | Description |
|---|---|---|---|
code |
dynamic |
— | code value consumed by this operation. |
operation |
dynamic |
— | operation value consumed by this operation. |
message |
dynamic |
— | Human-readable message associated with the operation. |
const FILE_ATTRIBUTE_DIRECTORY = 16Defines the file attribute directory constant used by the minisql platform file linux module.
const FILE_SHARE_DELETE = 4Defines the file share delete constant used by the minisql platform file linux module.
const FILE_SHARE_READ = 1Defines the file share read constant used by the minisql platform file linux module.
const FILE_SHARE_WRITE = 2Defines the file share write constant used by the minisql platform file linux module.
function fileExists(path)Reports whether a regular file exists at the path.
| Parameter | Type | Default | Description |
|---|---|---|---|
path |
dynamic |
— | Path of the file or directory used by the operation. |
function flush(handle)Forces writable data and metadata to stable storage.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle |
dynamic |
— | Native or runtime handle used by the operation. |
const GENERIC_READ = 2147483648Defines the generic read constant used by the minisql platform file linux module.
const GENERIC_WRITE = 1073741824Defines the generic write constant used by the minisql platform file linux module.
const INVALID_ARGUMENT = 9001POSIX adapter matching the historical file_win32 contract. Keeping this
const INVALID_FILE_ATTRIBUTES = 4294967295Defines the invalid file attributes constant used by the minisql platform file linux module.
const IO_FAILURE = 9005Defines the io failure constant used by the minisql platform file linux module.
function isImplemented()Reports that the Linux backend is complete.
const LOCK_CONFLICT = 9007Defines the lock conflict constant used by the minisql platform file linux module.
function lockWhole(handle, exclusive, failImmediately)Acquires a shared or exclusive whole-file lock.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle |
dynamic |
— | Native or runtime handle used by the operation. |
exclusive |
dynamic |
— | exclusive value consumed by this operation. |
failImmediately |
dynamic |
— | failImmediately value consumed by this operation. |
function movePath(source, destination, replaceExisting)Atomically renames a path and optionally replaces the destination.
| Parameter | Type | Default | Description |
|---|---|---|---|
source |
dynamic |
— | source value consumed by this operation. |
destination |
dynamic |
— | destination value consumed by this operation. |
replaceExisting |
dynamic |
— | replaceExisting value consumed by this operation. |
const OPEN_ALWAYS = 4Defines the open always constant used by the minisql platform file linux module.
const OPEN_EXISTING = 3Defines the open existing constant used by the minisql platform file linux module.
function openNative(path, desiredAccess, shareMode, creationDisposition, writeThrough)Opens a portable descriptor using the established Win32-like facade contract.
| Parameter | Type | Default | Description |
|---|---|---|---|
path |
dynamic |
— | Path of the file or directory used by the operation. |
desiredAccess |
dynamic |
— | desiredAccess value consumed by this operation. |
shareMode |
dynamic |
— | shareMode value consumed by this operation. |
creationDisposition |
dynamic |
— | creationDisposition value consumed by this operation. |
writeThrough |
dynamic |
— | writeThrough value consumed by this operation. |
function openNativePositionedRead(path, desiredAccess, shareMode, creationDisposition, writeThrough)Linux descriptors already use pread for explicit-offset reads, so the positioned-read constructor is identical to the ordinary native open.
| Parameter | Type | Default | Description |
|---|---|---|---|
path |
dynamic |
— | Path of the file or directory used by the operation. |
desiredAccess |
dynamic |
— | desiredAccess value consumed by this operation. |
shareMode |
dynamic |
— | shareMode value consumed by this operation. |
creationDisposition |
dynamic |
— | creationDisposition value consumed by this operation. |
writeThrough |
dynamic |
— | writeThrough value consumed by this operation. |
function pathAttributes(path)Returns the directory attribute bit, zero for files, or the invalid sentinel.
| Parameter | Type | Default | Description |
|---|---|---|---|
path |
dynamic |
— | Path of the file or directory used by the operation. |
function pathExists(path)Reports whether either a file or directory exists at the path.
| Parameter | Type | Default | Description |
|---|---|---|---|
path |
dynamic |
— | Path of the file or directory used by the operation. |
function readAt(handle, fileOffset, destination, destinationOffset, count)Positioned operations avoid a shared logical cursor when database readers use the same handle concurrently.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle |
dynamic |
— | Native or runtime handle used by the operation. |
fileOffset |
dynamic |
— | fileOffset value consumed by this operation. |
destination |
dynamic |
— | destination value consumed by this operation. |
destinationOffset |
dynamic |
— | destinationOffset value consumed by this operation. |
count |
dynamic |
— | Number of items or units to process. |
function readCurrent(handle, destination, count)Reads from the compatibility cursor and advances it by the transferred count.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle |
dynamic |
— | Native or runtime handle used by the operation. |
destination |
dynamic |
— | destination value consumed by this operation. |
count |
dynamic |
— | Number of items or units to process. |
function removeDirectory(path)Removes one empty directory, including portable error translation.
| Parameter | Type | Default | Description |
|---|---|---|---|
path |
dynamic |
— | Path of the file or directory used by the operation. |
function seek(handle, offset)Moves the compatibility cursor without changing the native descriptor offset.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle |
dynamic |
— | Native or runtime handle used by the operation. |
offset |
dynamic |
— | Zero-based offset at which processing starts. |
function size(handle)Returns the current physical file size.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle |
dynamic |
— | Native or runtime handle used by the operation. |
function targetMilestone()Returns the first MiniSQL milestone whose file contract this adapter implements.
function truncate(handle, newSize)Changes the physical file size through the portable backend.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle |
dynamic |
— | Native or runtime handle used by the operation. |
newSize |
dynamic |
— | newSize value consumed by this operation. |
const TRUNCATE_EXISTING = 5Defines the truncate existing constant used by the minisql platform file linux module.
function unlockWhole(handle)Releases the whole-file lock owned by this descriptor.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle |
dynamic |
— | Native or runtime handle used by the operation. |
function writeAt(handle, fileOffset, source, sourceOffset, count)Writes a source range at an explicit file offset without changing the cursor.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle |
dynamic |
— | Native or runtime handle used by the operation. |
fileOffset |
dynamic |
— | fileOffset value consumed by this operation. |
source |
dynamic |
— | source value consumed by this operation. |
sourceOffset |
dynamic |
— | sourceOffset value consumed by this operation. |
count |
dynamic |
— | Number of items or units to process. |
function writeCurrent(handle, source, count)Writes from the compatibility cursor and advances it by the transferred count.
| Parameter | Type | Default | Description |
|---|---|---|---|
handle |
dynamic |
— | Native or runtime handle used by the operation. |
source |
dynamic |
— | source value consumed by this operation. |
count |
dynamic |
— | Number of items or units to process. |