From 5e15f0abaafc28921c528615fbbc553bd86fa964 Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Mon, 3 Aug 2009 22:27:17 -0700 Subject: Don't use a stream class for now 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 -- cgit v0.10.2