🔍

Reagent file

Reagent for writing/reading bytes from a file.If file exists bytes will append to file.

Syntax: reagent[`file]

o)w:reagent[`file;`:/tmp/test.txt];
o)w "x"$"write\n"
o)

You can read file through the get to immediately after creating the reagent.

o)w:reagent[`file;`:/tmp/test.txt];
o)"c"$get w
"write\n"
o)w "x"$"append\n"
o)$get w
""
o)r:reagent[`file;`:/tmp/test.txt];
o)"c"$get r
"write\nappend\n"
o)