fs/File
value methods:
info
Returns the fs/FileInfo structure describing file.
(file info) -> fileinfo
chmod
Changes the mode of the file to mode
.
(file chmod mode(filemode)) -> self
chown
Changes the numeric uid and gid of the named file. On Windows, it will raise error.
(file chown uid(int) gid(int)) -> self
read
For each character, calling callback
. If callback
return false
, loop will exit.
(file read callback(lambda)) -> nil
read_line
For each line, calling callback
. If callback
return false
, loop will exit.
(file read_line callback(lambda)) -> nil
write
All parameters are first converted into strings, and then written to the file.
It returns an error
, if any.
(file write any...) -> nil
write_line
All parameters are first converted into strings, and then written to the file.
At last, append a new line.
It returns an error
, if any.
(file write_line any...) -> nil
close
Close the file to release the resource.
It returns an error
, if any.
(file close) -> nil