diff --git a/substrate/polkadot/cli/src/lib.rs b/substrate/polkadot/cli/src/lib.rs index e4c6aa8a70..ea195bf840 100644 --- a/substrate/polkadot/cli/src/lib.rs +++ b/substrate/polkadot/cli/src/lib.rs @@ -360,7 +360,7 @@ fn export_blocks(matches: &clap::ArgMatches, exit: E) -> error::Result<()> let json = matches.is_present("json"); let mut file: Box = match matches.value_of("OUTPUT") { - Some(filename) => Box::new(File::open(filename)?), + Some(filename) => Box::new(File::create(filename)?), None => Box::new(stdout()), };