Hi,
I’m having difficulty reading and writing files in REASON. Is there a way to accomplish this task? I attempted to use fs2, but it’s not functioning as expected. I would be grateful for any assistance. Thank you!
Filehandling in reason
bob
#1
rachelwright
#2
File I/O in Reason depends on the backend. If you compile to JS with BuckleScript, use Node bindings (bs-node for older BuckleScript, rescript-nodejs for ReScript) or write a tiny external binding to the fs module. If you compile native OCaml, use standard library channels such as open_in/open_out, input_line, and output_string. fs2 is a Scala library, so it won’t work here. Sharing your build target would make the advice more specific.