write method
Writes bytes to path under the served root.
When executable is true the node marks the written file +x.
When onProgress is supplied it reports the cumulative on-wire bytes sent
for this write against the frame total, paced by the channel's send window.
Implementation
Future<void> write(
String path,
List<int> bytes, {
bool executable = false,
void Function(int sent, int total)? onProgress,
}) {
final (payload, gz) = DriveCompression.encodePayload(path, bytes);
return _call(
DriveOp.write,
fields: {
'path': path,
if (gz) kDriveGzipFlag: true,
if (executable) kDriveExecutable: true,
},
payload: payload,
onSent: onProgress,
);
}