Skip to main content

os/fs/
mod.rs

1//! File system in os
2mod inode;
3mod stdio;
4
5use crate::mm::UserBuffer;
6/// File trait
7pub trait File: Send + Sync {
8    /// If readable
9    fn readable(&self) -> bool;
10    /// If writable
11    fn writable(&self) -> bool;
12    /// Read file to `UserBuffer`
13    fn read(&self, buf: UserBuffer) -> usize;
14    /// Write `UserBuffer` to file
15    fn write(&self, buf: UserBuffer) -> usize;
16}
17
18pub use inode::{OSInode, OpenFlags, list_apps, open_file};
19pub use stdio::{Stdin, Stdout};