-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Unify reading and writing files under a single API #2517
Conversation
RangeFile openFile(string path, FileMode mode = FileMode.read) | ||
|
||
/// Returns the content of a file | ||
public void[] readFile(NativePath path) |
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.
Should probably return ubyte[]
, even if that makes no difference to the GC, but it would match vibe.d's readFile
. Or do you want to implement vibe.d compatibility with the planned dependency injection interface?
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 originally used void[]
because that's what std.file
returns, but I agree that's probably better.
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.
Appender docs say you should construct appenders like this.
This removes the range API and instead uses Appender, while using a limited and centralized set of functions to read/write from files. The end goal is to permit dependency injection, which is a pre-requisite to extending the test-suite.
Rebased and changed appender |
This removes the range API and instead uses Appender, while using a limited and centralized set of functions to read/write from files.
The end goal is to permit dependency injection,
which is a pre-requisite to extending the test-suite.