JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

file/write

core-api


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

    (file/write f & bytes)

    Writes to a file `f`. Each value of `bytes` must be a string, 
    buffer, symbol, or keyword. 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