aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2009-08-04 05:27:17 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2009-08-04 05:27:17 (GMT)
commit5e15f0abaafc28921c528615fbbc553bd86fa964 (patch)
tree144622d1416836dd2cf77ba9c1ee640ed38be207
parent4263d57fbf69c252554ce28e1b7c8729825522c2 (diff)
downloadfusearchive-5e15f0abaafc28921c528615fbbc553bd86fa964.zip
fusearchive-5e15f0abaafc28921c528615fbbc553bd86fa964.tar.gz
fusearchive-5e15f0abaafc28921c528615fbbc553bd86fa964.tar.bz2
Don't use a stream class for now
-rw-r--r--FuseArchive/Storage/FileSystem.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/FuseArchive/Storage/FileSystem.py b/FuseArchive/Storage/FileSystem.py
index 547e567..a6687b5 100644
--- a/FuseArchive/Storage/FileSystem.py
+++ b/FuseArchive/Storage/FileSystem.py
@@ -62,8 +62,10 @@ def save_chunk( chunk ):
else:
# We found a spot, dump our data here
logging.debug( "No block here, creating new block" )
+ save_chunk = Chunk()
+ save_chunk.chunk = chunk
savechunk = open( checkpath, "wb" )
- savechunk.write( chunk )
+ savechunk.write( save_chunk.serialize() )
savechunk.close()
break
@@ -94,8 +96,8 @@ def load_chunk( key ):
if os.path.exists( "./storage/" + subpath ):
logging.debug( "Exporting chunk" )
- readchunk = FuseArchiveStream.open( "./storage/" + subpath )
- chunk = readchunk.read()
+ readchunk = open( "./storage/" + subpath )
+ chunk = Chunk.deserialize( readchunk.read() ).chunk
readchunk.close()
else:
raise IOError