JanetDocsPlaygroundI'm feeling luckyGitHub sign in

file/open



    cfunction

    (file/open path &opt mode)

    Open a file. `path` is an absolute or relative path, and `mode` is 
    a set of flags indicating the mode to open the file in. `mode` is a 
    keyword where each character represents a flag. If the file cannot 
    be opened, returns nil, otherwise returns the new file handle. Mode 
    flags:

    * r - allow reading from the file

    * w - allow writing to the file

    * a - append to the file

    Following one of the initial flags, 0 or more of the following 
    flags can be appended:

    * b - open the file in binary mode (rather than text mode)

    * + - append to the file instead of overwriting it

    * n - error if the file cannot be opened instead of returning nil


See also:file/closewith0 examplesSign in to add an example
Loading...