aboutsummaryrefslogtreecommitdiffstats
path: root/fusearchive.py
diff options
context:
space:
mode:
Diffstat (limited to 'fusearchive.py')
-rwxr-xr-xfusearchive.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/fusearchive.py b/fusearchive.py
index 9c13d68..9a06c92 100755
--- a/fusearchive.py
+++ b/fusearchive.py
@@ -793,7 +793,8 @@ class FuseArchive(Fuse):
# If this assert fails then write/ftruncate failed to set
# things up right somewhere
- assert save_size == self.size, "Calculated size " + str( self.size ) \
+ assert save_size == self.size, "Calculated size of " \
+ + self.orig_path + " = " + str( self.size ) \
+ " doesn't match internal size " + str( save_size ) \
+ "\nProbably a bug in write or ftruncate!"
logging.debug( "Size calculated is: " + str( self.size ) + ' (0x%x)' % self.size )
@@ -849,6 +850,7 @@ class FuseArchive(Fuse):
need_chunks = ( length / self.chunk_size )
extra_bytes = length % self.chunk_size
logging.debug( "Ftruncate - " + str(length) + ' (0x%x) ' % length )
+ logging.debug( " - self.size: " + str( self.size ) )
logging.debug( " - curr_chunks: " + str( curr_chunks ) )
logging.debug( " - need_chunks: " + str( need_chunks ) )
logging.debug( " - extra_bytes: " + str( extra_bytes ) )
@@ -863,7 +865,7 @@ class FuseArchive(Fuse):
logging.debug( "Creating 0 chunk file" )
self.chunks = []
self.chunk = ''
- elif self.size < length:
+ elif self.size <= length:
logging.debug( "Need to pad out file, writing/seeking to " + str( length ) )
# Just write out null bytes to the length requested, write will do this for us if we specify the offset