Import with #import "std/file_linux".
FileHandle :: struct { fd: s32; valid: bool; }DirectoryCursor :: struct { storage: *void; valid: bool; failed: bool; }DirectoryKind :: enum { Unknown = 0; Directory = 4; Regular = 8; Link = 10; Other = 255; }DirectoryEntry :: struct { name: [256]u8; name_count: s32; valid: bool; kind: DirectoryKind; }OpenRead :: (path: string) -> FileHandleOpenUpdate :: (path: string) -> FileHandleOpenWrite :: (path: string) -> FileHandleOpenReplace :: (path: string) -> FileHandleOpenNew :: (path: string) -> FileHandleCreate a writable file only when the path is unoccupied, including by a symbolic link. Creation is exclusive in the same native open operation.
OpenExclusivePrivate :: (path: string) -> FileHandleRemoveFile :: (path: string) -> boolPathIsLink :: (path: string) -> boolInspect the path itself, including a dangling link. No target is opened, no result is cached, and invalid paths cannot be shortened at a NUL. Windows includes junctions and other reparse points in this link policy.
PathExists :: (path: string) -> boolDirectoryExists :: (path: string) -> boolRenamePath :: (source: string, destination: string) -> boolRenameNoReplace :: (source: string, destination: string) -> boolLinkFile :: (source: string, destination: string) -> boolCreateDirectory :: (path: string) -> boolCreatePrivateDirectory :: (path: string) -> boolFileSize :: (file: FileHandle) -> s64ReadAt :: (file: FileHandle, output: []u8, offset: s64) -> s64WriteAt :: (file: FileHandle, input: []u8, offset: s64) -> s64WriteTextAt :: (file: FileHandle, input: string, offset: s64) -> s64Copy immutable text through a bounded buffer before writing it. The string may borrow read-only storage, so it must not be exposed as a mutable slice.
CloseFile :: (file: FileHandle) -> boolSyncFile :: (file: FileHandle) -> boolRead :: (file: FileHandle, output: []u8) -> s64Write :: (file: FileHandle, input: []u8) -> s64OpenDirectory :: (path: string) -> DirectoryCursorNextDirectoryEntry :: (cursor: *DirectoryCursor) -> DirectoryEntryCloseDirectory :: (cursor: *DirectoryCursor) -> bool