mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Add File.delete to CLI platform
This commit is contained in:
parent
d5cc75907f
commit
81d11e4edd
3 changed files with 43 additions and 10 deletions
|
@ -217,6 +217,16 @@ pub extern "C" fn roc_fx_fileReadBytes(path: &RocList<u8>) -> RocResult<RocList<
|
|||
RocResult::ok(RocList::empty())
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn roc_fx_fileDelete(roc_path: &RocList<u8>) -> RocResult<(), ReadErr> {
|
||||
match std::fs::remove_file(path_from_roc_path(roc_path)) {
|
||||
Ok(()) => RocResult::ok(()),
|
||||
Err(_) => {
|
||||
todo!("Report a file write error");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn roc_fx_sendRequest(roc_request: &glue::Request) -> glue::Response {
|
||||
let mut builder = reqwest::blocking::ClientBuilder::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue