openWriteEnsureParent method
Opens the file for writing, ensuring that its parent directories are created before opening.
Awaits the creation of the parent directory using recursive. By default,
recursive is true to ensure all non-existent parent directories are created.
Returns the standard IOSink by calling openWrite with mode and encoding.
Implementation
Future<IOSink> openWriteEnsureParent({
bool recursive = false,
FileMode mode = FileMode.write,
Encoding encoding = utf8,
}) async {
await parent.create(recursive: recursive);
return openWrite(mode: mode, encoding: encoding);
}