Skip to content
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

Writing Support #1

Open
heavens opened this issue Aug 31, 2022 · 1 comment
Open

Writing Support #1

heavens opened this issue Aug 31, 2022 · 1 comment

Comments

@heavens
Copy link

heavens commented Aug 31, 2022

First off, I wanted to quickly say great job on the project.

I was curious if there was any interest in having a formal writer api added to the filesystem. By formal, I just mean an established api where it'd expose some refined methods enabling writing capabilities. There's already a fair amount of substance to the library to the point where taking pre-existing readers and fashioning writer-equivalents wouldn't be a stretch. However, in regards to the project's current state, these additions would still be big changes by comparison.

If PRs are welcome and the feature is desirable, my proposal is to provide implementors the ability to create type-specific writers by using the existing Writer api within the std (or perhaps introducing a trait extending from Writer with additional convenience methods as an alternative flavor) so that handles may write and or flush buffered data to a file on disk. This support should come with a feature flag requiring users to opt in to utilize it. Specifics on implementation can be discussed further if the feature is welcome this was just my initial thought process.

In any event, great job with everything once again.

@jimvdl
Copy link
Owner

jimvdl commented Sep 1, 2022

Writing support has been on my backlog for a while now but never had the time (or energy) to actually implement it. If you want to give it a shot then by all means be my guest!

Implementing it as a feature and letting users opt into it sounds like a great idea, something like write would probably be fitting.

One thing off the top of my head is that internally Dat2 uses memmap2 which is in read-only mode, but can be put in write mode as well. I would preferably like to keep memmap2 because of RS3 support. Might get a bit tricky with undefined behaviour but I'm not too sure.

I'm always open to discussions. One thing to note: I'm extremely strapped for time right now so I'll eventually respond, a bit slow but I'll make sure to get back to you. Thanks in advance if you want to take this on!

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

No branches or pull requests

2 participants