diff options
-rwxr-xr-x | fusearchive.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fusearchive.py b/fusearchive.py index faf465a..2ed69ed 100755 --- a/fusearchive.py +++ b/fusearchive.py @@ -32,6 +32,7 @@ magic_blocksize = 1024 * 128 #magic_blocksize = 1024 magic_depth = 5 gzip_compress_level = 6 +chunkstyle = 'fs' # Memory for dirty blocks, per file (1M) dirty_size = 1024 * 1024 * 1; @@ -43,10 +44,20 @@ def dmsg(level,message): print str(level) + ": " + str(message) def save_chunk( chunk ): - return _save_chunk_zip( chunk ) + if chunkstyle == 'fs': + return _save_chunk_fs( chunk ) + elif chunkstyle == 'zip': + return _save_chunk_zip( chunk ) + else: + raise ValueError( 'Unknown chunk style' ) def load_chunk( key ): - return _load_chunk_zip( key ) + if chunkstyle == 'fs': + return _load_chunk_fs( key ) + elif chunkstyle == 'zip': + return _load_chunk_zip( key ) + else: + raise ValueError( 'Unknown chunk style' ) # This will write out a data block, it will return a key that can get this # data back later |