Write
(path: &str, buffer: &[u8])
| 425 | |
| 426 | // Write |
| 427 | pub fn write(path: &str, buffer: &[u8]) -> Result<usize, ()> |
| 428 | { |
| 429 | if let Some(handle) = new_file(&path) |
| 430 | { |
| 431 | if let Some(bytes) = crate::sys::sc::write(handle, buffer) |
| 432 | { |
| 433 | crate::sys::sc::close(handle); |
| 434 | return Ok(bytes); |
| 435 | } |
| 436 | } |
| 437 | Err(()) |
| 438 | } |