Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "bbn-json" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
anyhow = "1.0.68" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use std::{fs, path::PathBuf}; | ||
|
||
fn list_paths() -> anyhow::Result<Vec<PathBuf>> { | ||
let mut paths = vec![]; | ||
let read_dir = | ||
fs::read_dir("/Users/bouzuya/ghq/github.com/bouzuya/tmp-kraken-test/bbn-data-20230119")?; | ||
for root_dir_entry in read_dir { | ||
let root_dir_entry = root_dir_entry?; | ||
let year_path = root_dir_entry.path(); | ||
for year_dir_entry in fs::read_dir(year_path.as_path())? { | ||
let year_dir_entry = year_dir_entry?; | ||
let month_path = year_dir_entry.path(); | ||
for month_dir_entry in fs::read_dir(month_path.as_path())? { | ||
let month_dir_entry = month_dir_entry?; | ||
let date_path = month_dir_entry.path(); | ||
paths.push(date_path); | ||
} | ||
} | ||
} | ||
paths.sort(); | ||
Ok(paths) | ||
} | ||
|
||
fn main() -> anyhow::Result<()> { | ||
let paths = list_paths()?; | ||
for path in paths { | ||
println!("{:?}", path); | ||
} | ||
Ok(()) | ||
} |