diff options
author | Lars Wirzenius <liw@liw.fi> | 2010-07-01 14:00:01 +1200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2010-07-01 14:00:01 +1200 |
commit | 4073018b91ea1b2442226237f14069c07b071835 (patch) | |
tree | 67992a73d51ab2f2050bdf26eadf4d392238f7a3 | |
parent | c897e5418a859a2893d380477cbdb88f1728b544 (diff) | |
download | obnam-4073018b91ea1b2442226237f14069c07b071835.tar.gz |
Store chunk filenames using base 16.
Just 'cause I like them better that way. Well, actually,
these are shorter, and if I do an ls, the listing takes
up less space and is easier to scan.
-rw-r--r-- | obnamlib/store.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/obnamlib/store.py b/obnamlib/store.py index ad2226cc..d0f5db35 100644 --- a/obnamlib/store.py +++ b/obnamlib/store.py @@ -847,8 +847,8 @@ class Store(object): self.genstore.remove(filename) def _chunk_filename(self, chunkid): - basename = '%06d' % chunkid - subdir = '%d' % (chunkid / 10000) + basename = '%x' % chunkid + subdir = '%d' % (chunkid / (2**13)) return os.path.join('chunks', subdir, basename) @require_started_generation @@ -917,7 +917,7 @@ class Store(object): if self.fs.exists('chunks'): for dirname, subdirs, basenames in self.fs.depth_first('chunks'): for basename in basenames: - result.append(int(basename)) + result.append(int(basename, 16)) return result @require_started_generation |