with open('helloworld.txt', 'w') as filehandle:
filehandle.write('Hello, world!\n')
require("fs").writeFileSync("foo.txt", "foo", "utf8")
File.write!("helloworld.txt", "Hello, world!\n")
"helloworld.txt" <~ "Hello, world!\n"
use std::fs::{open, O_WRONLY}
fn main() {
let (mut f, _) = open("myfile.txt", O_WRONLY, 0)
let bytes = ([]byte)("Text to write")
f.write(bytes)
f.close()
}
Languages with Disk Output include Python, Node.js, Elixir, REBOL, Cython, Speedie, Jule, Boron
Languages without Disk Output include XML, JSON, CSS, HAML, JSON5, Ion, JSONiq, JSON with Comments, Superjson, Jsonnet, Hocon
This question asks: Does this language have methods or standard libraries for writing to disk?
HTML of this page generated by Features.ts