aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xfusearchive.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/fusearchive.py b/fusearchive.py
index f3b5093..032f0e9 100755
--- a/fusearchive.py
+++ b/fusearchive.py
@@ -40,6 +40,8 @@ def flag2mode(flags):
def inflate( src, dest ):
print "inflate!"
+# TODO: deflate only if the file has been modified
+
# Deflate a file, src is the unpacked file, dest is where we want to pack
# to, and we assume storage/ is where chunks are stored
def deflate( src, dest ):
@@ -65,15 +67,15 @@ def deflate( src, dest ):
# Write out our chunk
chars = list( digest )
print chars
- subparts = [];
- for l in range( 0, magic_depth ):
- subparts.append( "%02x" % ord( chars.pop( 0 ) ) )
# We make the hexdigest here, yeah we could just call hexdigest()
# but we need to essentially do this same thing to reassemble the
# file anyway
hexdigest = ''.join( [ "%02x" % ord( x ) for x in chars ] );
+ # Subparts just needs the first N chars
+ subparts = [ "%02x" % ord( x ) for x in chars[ :magic_depth ] ]
+
print subparts
subpath = '/'.join( subparts );
print "Subpath: " + subpath