-
Notifications
You must be signed in to change notification settings - Fork 5
Add the ability to create directories #215
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
Add the ability to create directories #215
Conversation
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.
Two comments, either is blocking.
/// | ||
/// If the parent path does not exist, then `PathNotFoundException` is thrown. | ||
void createDirectory(String path) { | ||
throw UnsupportedError('createDirectory'); |
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.
Not necessarily for this PR, but if you create a utility method unsupportedError(String)
, then this impl. could be:
void createDirectory(String path) => unsupportedError('createDirectory');
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'm talking with @lrhn now about whether this class should just be abstract
/interface
. If it lands that way, then all of these will disappear.
// Calling `GetLastError` for the first time causes the `GetLastError` | ||
// symbol to be loaded, which resets `GetLastError`. So make a harmless | ||
// call before the value is needed. | ||
win32.GetLastError(); |
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 may want to either:
- create a small 'primeLastError()' method in this library which does the same thing; this would let us avoid copying the 'why are we doing this' comment many times, or
- have a lastError() wrapper which accepts a closure; the wrapper can handle last error stuff, and the closure can do the actual work. this pattern may be less clear though
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.
Great idea! I'll go with the first idea, which will make it easy to remove when I fix this in the SDK.
Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.