2019-03-21 15:55:23 +00:00
|
|
|
use crate::vfs::file_like::{FileLike, Metadata};
|
|
|
|
use failure::Error;
|
|
|
|
|
|
|
|
pub struct Stdin;
|
|
|
|
pub struct Stdout;
|
|
|
|
pub struct Stderr;
|
|
|
|
|
|
|
|
impl FileLike for Stdin {
|
2019-03-22 01:05:03 +00:00
|
|
|
fn write(&mut self, _buf: &[u8], count: usize, _offset: usize) -> Result<usize, Error> {
|
|
|
|
println!("writing to {} byte to dev stream...", count);
|
|
|
|
Ok(count)
|
2019-03-21 15:55:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn read(&mut self, _buf: &mut [u8]) -> Result<usize, Error> {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn close(&self) -> Result<(), Error> {
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn metadata(&self) -> Result<Metadata, Error> {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
}
|