For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
file_descriptor
Higher level abstraction for file stream.
These are Mojo built-ins, so you don't need to import them.
For example, here's how to print to a file
var f = open("my_file.txt", "w")
var fd = RawFileDescriptor(f)
print("hello", file=fd)
f^.close()
Structs
-
BorrowedFileDescriptor: Copyable, non-owning view of aFileDescriptor. -
FileDescriptor: Owning file descriptor that is closed explicitly withclose(). -
RawFileDescriptor: File descriptor of a file.