-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fs, File and Path API #264
base: Abstract_file_access_layer_111
Are you sure you want to change the base?
fs, File and Path API #264
Conversation
…t_file_access_layer_111
async_util::call_async(crate::crypto::fs_api::r#async::fs::metadata(self)) | ||
} | ||
|
||
pub fn symlink_metadata(&self) -> Result<Metadata> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add rustdoc to indicate it's not implemented
Ok(stack.iter().collect::<PathBuf>()) | ||
} | ||
|
||
pub fn read_link(&self) -> Result<PathBuf> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't yet have links implemented and we need to ask links from EncryptedFs, not local path like std Path does, so make this unimplemented and add rustdoc too
Ok(PathBuf::from(path.read_link())) | ||
} | ||
|
||
pub fn read_dir(&self) -> Result<ReadDir> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to interrogate EncryptedFs, not std Path :) we have that method in there
#[cfg(test)] | ||
mod test; | ||
|
||
/// Wrapper around [`std::path::Path`] to allow use on EncryptedFs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this accurate? as we don't use std Path internally, maybe use similar
term?
@@ -57,7 +53,7 @@ async fn init_fs() -> anyhow::Result<()> { | |||
Ok(()) | |||
} | |||
|
|||
fn _add_create<'a>(opts: &'a mut OpenOptions, path: &Path) -> &'a mut OpenOptions { | |||
fn _add_create<'a>(opts: &'a mut OpenOptions, path: &std::path::Path) -> &'a mut OpenOptions { | |||
if !path.to_path_buf().exists() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here we need to use crypto::fs_api::path::Path
Issue #97
Implementation for:
crypto::fs_api::async::fs::OpenOptions
crypto::fs_api::async::fs::File (partial)
crypto::fs_api::async::fs (partial)
crypto::fs_api::path::Path.
crypto::fs_api::path::PathBuf.
Still on the to do list: