diff options
-rwxr-xr-x | fusearchive.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fusearchive.py b/fusearchive.py index 9a06c92..e86a774 100755 --- a/fusearchive.py +++ b/fusearchive.py @@ -674,19 +674,22 @@ class FuseArchive(Fuse): logging.debug( "This chunk falls on index: " + str( index ) + " rest: " + str( rest ) ) logging.debug( "We have " + str( len( self.chunks ) ) + " chunks" ) + logging.debug( "File size is: " + str( self.size ) ) # If index is higher than the number of blocks we current have it's a seek hole, so we need to extend our blocks out # We know these need to essentially be zeroed up to this size since if len( self.chunks ) - 1 < index: logging.debug( "Not enough chunks " + str( len( self.chunks ) ) + ", need " + - str( index ) + ", extending" ) + str( index + 1 ) + ", extending" ) this_index = 0 while this_index < index: self._load_chunk( this_index ) fill_null = self.chunk_size - len(self.chunk) logging.debug( "Filling this chunk with null, bytes: " + str( fill_null ) ) self.chunk += "\0" * fill_null + logging.debug( "Chunk is now: " + str( len( self.chunk) ) + " bytes" ) self.chunk_modified = True + self._save_chunk() this_index += 1 self._load_chunk( index ) @@ -697,6 +700,7 @@ class FuseArchive(Fuse): logging.debug( "Filling final chunk with null, bytes: " + str( fill_null ) ) self.chunk += "\0" * fill_null self.chunk_modified = True + self._save_chunk() buf_offset = 0 buf_len = len(buf) @@ -746,12 +750,14 @@ class FuseArchive(Fuse): index += 1 self.chunk_modified = True + self._save_chunk() self.modified = True if offset + len(buf) > self.size: self.size = offset + len(buf) - logging.debug( "Chunk size is now: " + str(len(self.chunk)) ) + logging.debug( "This chunk size is now: " + str(len(self.chunk)) ) logging.debug( "File size is now: " + str(self.size) ) + logging.debug( "Num Chunks: " + str( len( self.chunks ) ) ) # Mark us in the dirty cache dirty_cache[ self.orig_path ] = self |