module Scar::Util
Extended Modules
Defined in:
scar/util.crInstance Method Summary
-
#dir=(dir : String)
Sets the subdirectory to write files to
-
#read_file(name : String)
Reads filename in the specified directory as a
String
-
#read_file_bytes(name : String)
Same as read_file but reads it as
Bytes
-
#write_file(name : String, content : String)
Writes a
String
to given filename in the specified directory -
#write_file_bytes(name : String, content : Bytes)
Same as write_file but content is
Bytes
Instance Method Detail
def dir=(dir : String)
#
Sets the subdirectory to write files to
The given path is appended to the user directory:
- On windows:
%appdata%\<dir>\
- On linux:
~/.local/share/<dir>/
It is recommended to set your own subfolder via this method before writing to or reading from any files to avoid conficts.
def write_file(name : String, content : String)
#
Writes a String
to given filename in the specified directory