Revision d6c6f6c7 pithos/lib/hashfiler/blocker.py
b/pithos/lib/hashfiler/blocker.py | ||
---|---|---|
75 | 75 |
self.emptyhash = emptyhash |
76 | 76 |
|
77 | 77 |
def get_rear_block(self, blkhash, create=0): |
78 |
name = join(self.blockpath, hexlify(blkhash)) |
|
78 |
filename = hexlify(blkhash) |
|
79 |
dir = join(self.blockpath, filename[0:2], filename[2:4], filename[4:6]) |
|
80 |
if not exists(dir): |
|
81 |
makedirs(dir) |
|
82 |
name = join(dir, filename) |
|
79 | 83 |
return ContextFile(name, create) |
80 | 84 |
|
81 | 85 |
def check_rear_block(self, blkhash): |
82 |
name = join(self.blockpath, hexlify(blkhash)) |
|
86 |
filename = hexlify(blkhash) |
|
87 |
dir = join(self.blockpath, filename[0:2], filename[2:4], filename[4:6]) |
|
88 |
name = join(dir, filename) |
|
83 | 89 |
return exists(name) |
84 | 90 |
|
85 | 91 |
def block_hash(self, data): |
Also available in: Unified diff