Third attempt to make a workaround for the Linux specific bug in the fs crate, to make it support backslashess in top_dir path

This commit is contained in:
Anynomouss
2025-04-06 21:59:36 +02:00
parent 004c46958b
commit cd2f64c234
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -189,7 +189,11 @@ pub fn initial_setup_wallet(
) -> Result<GlobalWalletConfig, ConfigError> {
if create_path {
if let Some(p) = data_path.clone() {
fs::create_dir_all(p)?;
// Fix for a bug in the rust fs package to handle "\" in paths
let p_fix = p.clone();
let p_fix = p_fix.to_str().unwrap().to_owned().replace("\\", "/");
let p_fix = PathBuf::from(p_fix);
fs::create_dir_all(p_fix)?;
}
}
+1 -1
View File
@@ -86,7 +86,7 @@ fn real_main() -> i32 {
let res = args.value_of("top_level_dir");
match res {
Some(d) => {
let d = d.to_owned().replace("/", "\\");
let d = d.to_owned().replace("/", "\\"); // Fix for fs to work with paths on Linux
current_dir = Some(PathBuf::from(d));
}
None => {