EMILUA(3em)
hey bestie!! welcome to the EMILUA(3em) page β itβs part of the Emilua reference, and Emilua is your Lua execution engine π β¨
β¨ NAME β¨
Emilua β Lua execution engine π§π
π¦ SYNOPSIS π¦
local fs = require "filesystem"
fs.open(path: fs.path, flags: string[][, mode: integer]) -> file_descriptor
π DESCRIPTION π
Open the file using the specified path. You hand it path, and it gives you a file_descriptor β slay π
Behind the scenes, the implementation for this function always includes the flag O_NOCTTY β no cap, itβs just in there π₯
flags may contain these values:
"append"β opens the file in append mode."create"β creates the file if it does not exist.
Note: this one requires themodeargument. Example:fs.mode(7, 7, 7).
"directory"β fails ifpathresolves to a non-directory file."exclusive"β ensures a new file gets created. Must be combined with"create"."no_follow"β fails ifpathresolves to a symbolic link."path"β gets a stable reference to an inode without actually opening the contents."read_only"β opens the file for reading."read_write"β opens the file for reading and writing."sync_all_on_write"β opens the file so that write operations automatically synchronise the file data and metadata to disk (FILE_FLAG_WRITE_THROUGH/O_SYNC)."temporary"β creates an unnamed temporary regular file.
Note: this one requires themodeargument. Example:fs.mode(7, 7, 7).
"truncate"β opens the file with any existing contents truncated."write_only"β opens the file for writing.
Note: not available on Windows.
π SEE ALSO π
file.stream(3em)β go check that one out too, bestie π¦
okay byeee bestie β source/version Emilua 0.12.1-nixpkgs1, date 1980-01-01 π«Άπ
π¦ where this page comes from
- nixos 26.05: emilua 0.12.1
- nixpkgs unstable: emilua 0.12.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms