fix chunk store file paths

This commit is contained in:
Dietmar Maurer 2018-12-16 13:52:16 +01:00
parent 0cd9d4206f
commit af3e7d7551
1 changed files with 3 additions and 3 deletions

View File

@ -117,7 +117,7 @@ impl ChunkStore {
// create 4096 subdir
for i in 0..4096 {
let mut l1path = base.clone();
let mut l1path = chunk_dir.clone();
l1path.push(format!("{:03x}",i));
if let Err(err) = std::fs::create_dir(&l1path) {
bail!("unable to create chunk subdir {:?} - {}", l1path, err);
@ -160,7 +160,7 @@ impl ChunkStore {
self.hasher.result(&mut digest);
//println!("DIGEST {}", u256_to_hex(&digest));
let mut chunk_path = self.base.clone();
let mut chunk_path = self.chunk_dir.clone();
let prefix = u256_to_prefix(&digest);
chunk_path.push(&prefix);
let digest_str = u256_to_hex(&digest);
@ -176,7 +176,7 @@ impl ChunkStore {
}
}
let mut chunk_dir = self.base.clone();
let mut chunk_dir = self.chunk_dir.clone();
chunk_dir.push(&prefix);
if let Err(_) = std::fs::create_dir(&chunk_dir) { /* ignore */ }