aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2009-07-29 05:41:28 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2009-07-29 05:41:28 (GMT)
commit8c91367a60e68dea764dee457fac5570f9f0111b (patch)
tree3bc3b3676ea4ace7541891cb57a18548aa4c9224
parentc057ef0ea7bd80874415e59ec62e544dd8ed5633 (diff)
downloadfusearchive-8c91367a60e68dea764dee457fac5570f9f0111b.zip
fusearchive-8c91367a60e68dea764dee457fac5570f9f0111b.tar.gz
fusearchive-8c91367a60e68dea764dee457fac5570f9f0111b.tar.bz2
Catch when size == truncate size, some more debugging stuff
-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