IO

writeFile


(let writeFile (fun (_name _content) (...))) Write content to a file. Return nil

Parameters

  • filename: path to the file to write to (will be overwritten if it exists)
  • content: can be any valid ArkScript value

Author

@SuperFola

Example

(io:writeFile "hello.json" "{\"key\": 12}")

appendToFile


(let appendToFile (fun (_name _content) (...))) Append content to a file. Return nil

Parameters

  • filename: path to the file to append to
  • content: can be any valid ArkScript value

Author

@SuperFola

Example

(io:writeFile "hello.json" "{\"key\": 12}")

readFile


(let readFile (fun (_name) (...))) Read the content from a file as a String

Parameter

  • filename: the path of the file to read

Author

@SuperFola

Example

(io:readFile "hello.json")

fileExists?


(let fileExists? (fun (_name) (...))) Check if a file exists, return True or False

Parameter

  • filename: the path of the file

Author

@SuperFola

Example

(io:fileExists? "hello.json")

listFiles


(let listFiles (fun (_path) (...))) List files in a folder, as a List of String

Parameter

  • path: A directory

Author

@SuperFola

Example

(io:listFiles "/tmp/hello")

dir?


(let dir? (fun (_path) (...))) Check if a path represents a directory

Parameter

  • path: A directory

Author

@SuperFola

Example

(io:dir? "/tmp/hello")

makeDir


(let makeDir (fun (_path) (...))) Create a directory

Parameter

  • path: A directory

Author

@SuperFola

Example

(io:makeDir "/tmp/myDir")

removeFile


(let removeFile (fun (_path) (...))) Delete file

Parameter

  • filename: path to file

Author

@SuperFola

Example

(io:removeFile "/tmp/test.ark")