aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2009-07-22 23:20:21 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2009-07-22 23:20:21 (GMT)
commit8572842c51475e1b7bf5061512ff670f047fdb19 (patch)
tree49d3499ddc75c498d8e94dfa773f7595a39a0785
parent46d5d21e933f92ce9eaf32dd69e02db562945024 (diff)
downloadfusearchive-8572842c51475e1b7bf5061512ff670f047fdb19.zip
fusearchive-8572842c51475e1b7bf5061512ff670f047fdb19.tar.gz
fusearchive-8572842c51475e1b7bf5061512ff670f047fdb19.tar.bz2
Some better list handling to extract sub paths
-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