diff options
-rw-r--r-- | stream.c | 2 | ||||
-rw-r--r-- | txr.1 | 20 |
2 files changed, 14 insertions, 8 deletions
@@ -4217,7 +4217,7 @@ static val sh(val command) val remove_path(val path, val throw_on_error) { if (w_remove(c_str(path)) < 0) { - if (throw_on_error) + if (default_null_arg(throw_on_error) || errno != ENOENT) uw_throwf(file_error_s, lit("trying to remove ~a: ~d/~s"), path, num(errno), string_utf8(strerror(errno)), nao); return nil; @@ -47628,15 +47628,21 @@ which may be a file, directory or something else. If successful, it returns .codn t . -A failure to remove the object results in an exception of type -.codn file-error , -unless -.meta throw-on-error-p -is present, and its value is +The optional Boolean parameter +.metn throw-on-error-p , +which defaults to .codn nil . -In that case, failure is indicated by a + +A failure to remove the object results in an exception of type +.code file-error +being thrown, unless the failure reason is that the object indicated by +.meta path +doesn't exist. In this non-existence case, the behavior is controlled by the +.meta throw-on-error +argument. If that argument is true, the exception is thrown. Otherwise, +the function returns normally, producing the value .code nil -return value. +to indicate that it didn't perform a removal. .coNP Function @ rename-path .synb |