]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
immutable: base32-encode the keys to generate cache filenames that will work on all...
authorZooko O'Whielacronx <zooko@zooko.com>
Wed, 8 Jul 2009 15:26:33 +0000 (08:26 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Wed, 8 Jul 2009 15:26:33 +0000 (08:26 -0700)
src/allmydata/immutable/filenode.py

index 1e83f344839c5a38b6cd4e7c6bd3e52ca57fa26b..fac141b744fda5da6dfd822df7867ca385bd9bfa 100644 (file)
@@ -105,7 +105,7 @@ class DownloadCache:
     def read(self, consumer, offset, size):
         assert offset+size <= self.get_filesize()
         if not self.cachefile:
-            self.cachefile = self.cachedirectorymanager.get_file(self._storage_index)
+            self.cachefile = self.cachedirectorymanager.get_file(base32.b2a(self._storage_index))
         f = PortionOfFile(self.cachefile.get_filename(), offset, size)
         d = basic.FileSender().beginFileTransfer(f, consumer)
         d.addCallback(lambda lastSent: consumer)
@@ -146,7 +146,7 @@ class DownloadCache:
 
     def get_filesize(self):
         if not self.cachefile:
-            self.cachefile = self.cachedirectorymanager.get_file(self._storage_index)
+            self.cachefile = self.cachedirectorymanager.get_file(base32.b2a(self._storage_index))
         try:
             filesize = os.stat(self.cachefile.get_filename())[stat.ST_SIZE]
         except OSError:
@@ -156,7 +156,7 @@ class DownloadCache:
 
     def open(self, size):
         if not self.cachefile:
-            self.cachefile = self.cachedirectorymanager.get_file(self._storage_index)
+            self.cachefile = self.cachedirectorymanager.get_file(base32.b2a(self._storage_index))
         self.f = open(self.cachefile.get_filename(), "wb")
 
     def write(self, data):