Closed grzenow4 closed 1 year ago
Fixes: #39 Depends on: #24 #27
This PR introduces structs OpenOptions and File
OpenOptions
File
#[derive(Clone)] pub struct OpenOptions { read: bool, write: bool, create: bool, } pub struct File { inner: UniquePtr<file_t>, }
which allow for basic I/O operations such as read and write to a file. All the introduced methods are:
read_dma
write_dma
flush
close
size
Reading and writing to a file is done via DmaBuffer struct:
DmaBuffer
const ALIGN: usize = 512; const CHUNK_SIZE: usize = 4096; pub struct DmaBuffer { buffer: *mut u8, size: usize, }
Fixes: #39 Depends on: #24 #27
This PR introduces structs
OpenOptions
andFile
which allow for basic I/O operations such as read and write to a file. All the introduced methods are:
read_dma
write_dma
flush
close
size
Reading and writing to a file is done via
DmaBuffer
struct: