last_error
is updated to contains the error information on error, and null on success.
# Delete a file from the file system.
#
# `last_error` is updated to contains the error information on error, and null on success.
fun delete
do
var res = path.to_cstring.file_delete
if not res then
last_error = new IOError("Cannot delete `{path}`: {sys.errno.strerror}")
else
last_error = null
end
end
lib/core/file.nit:492,2--503,4