{id: files}
{id: files-intro}
{id: read-from-file} {i: read} {i: slurp}
- Read the content of the whole file
- Raise exception
File::NotFoundError
if file does not exist
{id: read-lines-into-array} {id: read_lines}
{id: read-file-line-by-line} {i: each_line}
{id: write-to-file} {i: write}
- Write the content to the file
- Raise exception if cannot open file for writing
- e.g. raise
File::NotFoundError
if parent directory does not exist
{id: append-to-file} {i: append}
- This is a bug in my code, but it still creates the file with some strange rights
---xr-Sr--
- The
ameba
linter will catch this error.
{id: file-exists} {i: exists?}
{id: size-of-file} {i: empty?} {i: size}
{id: modified-date-of-file} {i: modification_time}
{id: counter}
{id: multi-counter-json} {i: json} {i: from_json} {i: to_json}
{id: multi-counter-yaml} {i: yaml} {i: from_yaml} {i: to_yaml}