operator > method

  1. @override
Future<void> operator >(
  1. File file
)

Writes to file. Platform independent. e.g.

$("echo 1") > File("./temp");

Will write "1" to file "temp". Which is equivlent to

$("echo 1 > ./temp")();

on MacOs and Linux. But the above will write "1 " to "temp" on windows.

Implementation

@override
Future<void> operator >(io.File file) async {
  await file.writeAsBytes(await stdout,
      mode: io.FileMode.writeOnly, flush: true);
}