Modify IoFactory's fs_mkdir, and add fs_rename

The invocation for making a directory should be able to specify a mode to make
the directory with (instead of defaulting to one particular mode). Additionally,
libuv and various OSes implement efficient versions of renaming files, so this
operation is exposed as an IoFactory call.
This commit is contained in:
Alex Crichton 2013-10-25 16:50:08 -07:00
parent d7b6502784
commit 7bf58c2baa
5 changed files with 41 additions and 4 deletions

View file

@ -102,8 +102,9 @@ pub trait IoFactory {
-> Result<~RtioFileStream, IoError>;
fn fs_unlink(&mut self, path: &CString) -> Result<(), IoError>;
fn fs_stat(&mut self, path: &CString) -> Result<FileStat, IoError>;
fn fs_mkdir(&mut self, path: &CString) -> Result<(), IoError>;
fn fs_mkdir(&mut self, path: &CString, mode: int) -> Result<(), IoError>;
fn fs_rmdir(&mut self, path: &CString) -> Result<(), IoError>;
fn fs_rename(&mut self, path: &CString, to: &CString) -> Result<(), IoError>;
fn fs_readdir(&mut self, path: &CString, flags: c_int) ->
Result<~[Path], IoError>;
fn spawn(&mut self, config: ProcessConfig)