system.remove
Defined in module
"system"from "system" import removeDeletes the file at the given path, throws error in case of fail
Parameters
path | string | path of the file to delete |
Errors
Throws remove() failed if the underlying C remove() call fails, for example because the file does not exist or is in use. The message carries no further detail: no path, no errno, no reason.
Notes
Unlike getenv, setenv and system, remove is built the same way on every target; there is no platform stub.
No example runs here because deleting a file changes the machine, which every example on this site must avoid. Typical use:
from "system" import remove
try {
remove("scratch.tmp")
} catch (e) {
println(e) // "remove() failed"
}
See also
rename | Renames the file from old to new path, throws error in case of fail |
| system | module index |