Skip to content

Add random file access support #36

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jalcine
Copy link

@jalcine jalcine commented Jul 18, 2022

Will close #35 by providing a light implementation of seekable file support

@jalcine jalcine marked this pull request as ready for review July 18, 2022 21:31
@manuel-woelker
Copy link
Owner

Thanks for the PR! It looks like rewind() is not available in 1.40 yet, but seek(SeekFrom::Start(0)) should work as well.

I'll try to take a deeper look tomorrow!

@jalcine
Copy link
Author

jalcine commented Jul 25, 2022

Good catch w.r.t the tests; I'll patch that up!

(Originally published at: https://jacky.wtf/2022/7/rJ3S)

///
/// This is, by default, a no-op.
fn sync(&self, _path: &str) -> VfsResult<()> {
Ok(())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering what the default should be if the filesystem does not support sync...

Return OK from sync while not actually doing anything might lead to data loss, which I'd rather avoid.

It might be better to not provide a default impl and leave it up to the actual implementations.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree!

@@ -47,6 +45,32 @@ pub trait FileSystem: Debug + Sync + Send + 'static {
fn move_dir(&self, _src: &str, _dest: &str) -> VfsResult<()> {
Err(VfsError::NotSupported)
}

/// Informs the filesystem to 'flush' its potentially cached information.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc comment is probably a copy/paste error ;-)

@manuel-woelker
Copy link
Owner

It looks the error changes I just merged caused a merge conflict, could you resolve that?

Sorry for the extra work!

@jalcine
Copy link
Author

jalcine commented Aug 17, 2022

I can! Apologies for the delay!

(Originally published at: https://jacky.wtf/2022/8/Hn2a)

@jalcine jalcine force-pushed the add-random-access-file branch from 8e65046 to 9863827 Compare August 18, 2022 18:21
@manuel-woelker
Copy link
Owner

Thanks for the update! It looks the CI build is still failing, and there seem to be some formatting issues.

Quick note - I'm currently on vacation, might be slow to respond the next week or so.

@manuel-woelker
Copy link
Owner

Hi again, just wanted to check in. Are you still working on this?

@jalcine
Copy link
Author

jalcine commented Sep 12, 2022

Hey! I am, just got caught up with some life stuff that's forced me to focus on it. But I am still focused on landing this!

(Originally published at: https://jacky.wtf/2022/9/N-45)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Seek + Write from VfsPath
2 participants