Merge pull request #968 from pmoura/add_make_directory_path_predicate
Add make_directory_path/1 predicate to the files library
This commit is contained in:
@@ -878,6 +878,17 @@ impl MachineState {
|
||||
}
|
||||
}
|
||||
}
|
||||
&SystemClauseType::MakeDirectoryPath => {
|
||||
let directory = self.heap_pstr_iter(self[temp_v!(1)]).to_string();
|
||||
|
||||
match fs::create_dir_all(directory) {
|
||||
Ok(_) => {}
|
||||
_ => {
|
||||
self.fail = true;
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
}
|
||||
&SystemClauseType::DeleteFile => {
|
||||
let file = self.heap_pstr_iter(self[temp_v!(1)]).to_string();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user