aboutsummaryrefslogtreecommitdiffstats
path: root/dump_chunkfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'dump_chunkfile.py')
-rwxr-xr-xdump_chunkfile.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/dump_chunkfile.py b/dump_chunkfile.py
new file mode 100755
index 0000000..84fbfac
--- /dev/null
+++ b/dump_chunkfile.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+
+import FuseArchive.ChunkFile, sys, re, os
+
+# Run this in the storage area, basically 'cat' the file
+file = re.sub( '^.*?tree', '', sys.argv[ 1 ] )
+sys.stderr.write( "Opening file: %s\n" % file )
+
+f = FuseArchive.ChunkFile.ChunkFile( file, os.O_RDONLY, 0 )
+
+sys.stderr.write( "File is: %d bytes\n" % f.size )
+
+offset = 0
+blocksize = 4096
+while offset <= f.size:
+ data = f.read( blocksize, offset )
+ sys.stdout.write( data )
+ offset += blocksize