aboutsummaryrefslogtreecommitdiffstats
path: root/dump_chunk.py
blob: b28d2e7e880c45a7bfce52ba9c8a40d9a2e5f747 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python

import FuseArchive.Chunk, sys, pickle, os

# This prints some debug info about a chunk
f = FuseArchive.Chunk.Chunk.parse_header( open( sys.argv[ 1 ] ).read(
    FuseArchive.Chunk.Chunk.header_length() ) )
print f
os.system( "ls -l %s" % sys.argv[ 1 ] )

# Detail
if len( sys.argv ) == 3:
    f = FuseArchive.Chunk.Chunk.deserialize( open( sys.argv[ 1 ] ).read() )
    pickle.dump( f, sys.stdout, 0 )