JanetDocsPlaygroundI'm feeling luckyGitHub sign in

file/write



    cfunction
    src/core/io.c on line 224, column 1

    (file/write f bytes)

    Writes to a file. 'bytes' must be string, buffer, or symbol. 
    Returns the file.


See also:spit2 examplesSign in to add an example
Loading...
# opens a file named filename for writing, and writes Hello World!
(def f (file/open "filename" :w))
(file/write f "Hello World!")
(file/flush f)
(file/close f)
terminalcommandPlayground
#!/usr/bin/env janet
# echo stdin to stdout.
(file/write stdout (file/read stdin :all))
cellularmitosisPlayground