ADDED: delete_file/1, addressing a remaining aspect of #511

This commit is contained in:
Markus Triska
2020-07-14 22:16:15 +02:00
parent 53d39ccb4b
commit 5134e64cae
3 changed files with 18 additions and 0 deletions

View File

@@ -880,6 +880,16 @@ impl MachineState {
}
}
}
&SystemClauseType::DeleteFile => {
let file = self.heap_pstr_iter(self[temp_v!(1)]).to_string();
match fs::remove_file(file) {
Ok(_) => { }
_ => { self.fail = true;
return Ok(());
}
}
}
&SystemClauseType::AtEndOfExpansion => {
if self.cp == LocalCodePtr::TopLevel(0, 0) {
self.at_end_of_expansion = true;