mirror of
https://github.com/Magnus167/msyrs.git
synced 2025-08-20 13:00:01 +00:00
fix: enhance save_path handling in JPMaQSDownload to ensure valid directory structure
This commit is contained in:
parent
9e1197662e
commit
5bcc1da4f0
@ -246,8 +246,12 @@ impl JPMaQSDownload {
|
|||||||
folder_path: &str,
|
folder_path: &str,
|
||||||
) -> Result<(), Box<dyn Error>> {
|
) -> Result<(), Box<dyn Error>> {
|
||||||
// if the folder path does not exist, create it
|
// if the folder path does not exist, create it
|
||||||
// let save_path = folder_path.to_string() + "/JPMaQSData/";
|
|
||||||
let save_path = format!("{}/JPMaQSData/", folder_path);
|
let save_path = format!("{}/JPMaQSData/", folder_path);
|
||||||
|
let save_path = std::path::Path::new(&save_path)
|
||||||
|
.components()
|
||||||
|
.collect::<std::path::PathBuf>()
|
||||||
|
.to_string_lossy()
|
||||||
|
.to_string();
|
||||||
std::fs::create_dir_all(save_path.clone())?;
|
std::fs::create_dir_all(save_path.clone())?;
|
||||||
|
|
||||||
// get ticker count, and split into chunks of batch_size
|
// get ticker count, and split into chunks of batch_size
|
||||||
|
Loading…
x
Reference in New Issue
Block a user