Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Create directories
Browse files Browse the repository at this point in the history
  • Loading branch information
brad-richardson committed Jul 3, 2024
1 parent 0b10c4b commit b1fbf56
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ impl ElementSink {
}

pub fn finish_batch(&mut self) {
let file = File::create(self.new_file_path(&self.filenum)).unwrap();
let path_str = self.new_file_path(&self.filenum);
let path = std::path::Path::new(&path_str);
let prefix = path.parent().unwrap();
std::fs::create_dir_all(prefix).unwrap();
let file = File::create(path).unwrap();

let batch = self.osm_builder.finish().unwrap();

Expand Down

0 comments on commit b1fbf56

Please sign in to comment.