aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrinity Pointard <trinity.pointard@gmail.com>2021-04-06 20:50:03 +0200
committerTrinity Pointard <trinity.pointard@gmail.com>2021-04-08 15:42:14 +0200
commit4d5263ccf36518e1efec3a37ea5bc285a83fe8d2 (patch)
treebf9bafc72e14e5b00890b8ce5260970c01d819ce /src
parente4b66a9e28fc3fd72dbb4d212f733c18d7b2c5a5 (diff)
downloadgarage-4d5263ccf36518e1efec3a37ea5bc285a83fe8d2.tar.gz
garage-4d5263ccf36518e1efec3a37ea5bc285a83fe8d2.zip
change extention for compressed files
set_extension don't behave verywell with extensions containing multiple dots
Diffstat (limited to 'src')
-rw-r--r--src/model/block.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/model/block.rs b/src/model/block.rs
index ec714fef..0308c611 100644
--- a/src/model/block.rs
+++ b/src/model/block.rs
@@ -174,7 +174,7 @@ impl BlockManager {
fs::create_dir_all(&path).await?;
path.push(hex::encode(hash));
if checksum.is_some() {
- path.set_extension("zst.b2");
+ path.set_extension("zst_b2");
}
let mut f = fs::File::create(path).await?;
@@ -198,7 +198,7 @@ impl BlockManager {
f.map(|f| (f, false)).map_err(Into::into)
}
Ok(true) => {
- path.set_extension("zst.b2");
+ path.set_extension("zst_b2");
let f = fs::File::open(&path).await;
f.map(|f| (f, true)).map_err(Into::into)
}
@@ -270,7 +270,7 @@ impl BlockManager {
async fn is_block_compressed(&self, hash: &Hash) -> Result<bool, Error> {
let mut path = self.block_path(hash);
- path.set_extension("zst.b2");
+ path.set_extension("zst_b2");
if fs::metadata(&path).await.is_ok() {
return Ok(true);
}