EMILUA(3em)
π EMILUA(3em) π
bestie, welcome to the Emilua reference page for file_descriptor. This is the EMILUA(3em) manual page, and we're gonna get you comfy with it β no cap. It's giving βlow-level fd energyβ but make it cute. π
β¨ NAME β¨
Emilua β Lua execution engine.
π¦ DESCRIPTION π¦
Okay so this whole page is about a file descriptor. That's the main character.
π¨ Note: it cannot be created directly. Not me trying to instantiate an fd from scratch β nope, not happening.
πͺ Note: on Windows,file_descriptoris only implemented for pipes andfile.stream. So Windows besties, that's the vibe check.
π FUNCTIONS π
close(self)β closes the file descriptor w/o waiting for the GC. She said bye immediately, no ghosting the garbage collector.dup(self) β file_descriptorβ creates a new file descriptor that refers to the same open file description. Sibling fds, same underlying vibe.is_socket(self, family: unix"|"inet"|"inet6"[, type: stream |"datagram"|"seqpacket"[, protocol: tcp |"udp"]]) β boolean"β checks whether the file descriptor refers to a socket of the specified family, type, and protocol.kcmp(self, other: file_descriptor) β integerβ seekcmp(2)andKCMP_FILE. Like a little fd comparison check, iykyk.openat(self, path: filesystem.path, flags: string[][, mode: integer]) β file_descriptorβ the implementation for this function always includes the flagO_NOCTTYbehind the scenes. Like a secret little helper. π«Ά
flags may contain:
"append"β open the file in append mode."create"β create the file if it does not exist."directory"β fail ifpathresolves to a non-directory file."exclusive"β ensure a new file is created. Must be combined withcreate."no_follow"β fail ifpathresolves to a symbolic link."path"β get a stable reference to an inode without actually opening the contents."read_only"β open the file for reading."read_write"β open the file for reading and writing."sync_all_on_write"β open the file so that write operations automatically synchronise the file data and metadata to disk (O_SYNC)."temporary"β create an unnamed temporary regular file."truncate"β open the file with any existing contents truncated."write_only"β open the file for writing."resolve_beneath"β path resolution must not cross the fd directory."resolve_in_root"β treat the directory referred to bydirfdas the root directory while resolvingpathname. Absolute symbolic links are interpreted relative todirfd."resolve_no_magiclinks"β disallow all magic-link resolution during path resolution."resolve_no_symlinks"β disallow resolution of symbolic links during path resolution."resolve_no_xdev"β disallow traversal of mount points during path resolution (including all bind mounts)."resolve_cached"β make the open operation fail unless all path components are already present in the kernelβs lookup cache.
See openat(3).
cap_get(self) β system.linux_capabilitiesβ seecap_get_fd(3).cap_set(self, caps: system.linux_capabilities)β seecap_set_fd(3).cap_rights_limit(self, rights: string[])β seecap_rights_limit(2).
Parameters:
rights: string[]β one of these cuties:"accept""acl_check""acl_delete""acl_get""acl_set""bind""bindat""chflagsat""connect""connectat""create""event""extattr_delete""extattr_get""extattr_list""extattr_set""fchdir""fchflags""fchmod""fchmodat""fchown""fchownat""fcntl""fexecve""flock""fpathconf""fsck""fstat""fstatat""fstatfs""fsync""ftruncate""futimes""futimesat""getpeername""getsockname""getsockopt""ioctl""kqueue""kqueue_change""kqueue_event""linkat_source""linkat_target""listen""lookup""mac_get""mac_set""mkdirat""mkfifoat""mknodat""mmap""mmap_r""mmap_rw""mmap_rwx""mmap_rx""mmap_w""mmap_wx""mmap_x""pdgetpid""pdkill""peeloff""pread""pwrite""read""recv""renameat_source""renameat_target""seek""sem_getvalue""sem_post""sem_wait""send""setsockopt""shutdown""symlinkat""ttyhook""unlinkat""write"
cap_rights_contains(self, rights: string[]) β booleanβ returns whether all the given capability rights are set.rightshas the same set of allowed values ascap_rights_limit().cap_rights_remove(self, rights: string[])β it performs the following actions (in a non-atomic manner):- Query current capabilities on the file descriptor.
- Remove
rightsfrom the returned set. - Limit capabilities to the new set.
rights has the same set of allowed values as cap_rights_limit().
cap_ioctls_limit(self, cmds: integer[])β seecap_ioctls_limit(2).cap_ioctls_get(self) β integer[]| all""β seecap_ioctls_get(2).cap_fcntls_limit(self, fcntlrights: string[])β seecap_fcntls_limit(2).
Parameters:
fcntlrights: string[]β one of:"getfl""setfl""getown""setown"
cap_fcntls_get(self) β string[]β seecap_fcntls_get(2).
πΈ PROPERTIES πΈ
non_blocking: booleanβ query/set thefcntlflagO_NONBLOCK.type: stringβ one of:"regular""directory""symlink""block""character""fifo""socket""unknown"
π METAMETHODS π
__tostring()β produces a string in the format"/dev/fd/%i"where"%i"is the integer value as seen by the OS.
Thatβs the whole page, 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