diff options
Diffstat (limited to 'FuseArchive')
-rw-r--r-- | FuseArchive/Storage/FileSystem.py | 8 |
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 |