aboutsummaryrefslogtreecommitdiffstats
path: root/FuseArchive
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2009-08-06 23:31:22 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2009-08-06 23:31:22 (GMT)
commit7f8c15ebab3a2ebe8d2929f1b3e5abb160866b57 (patch)
treef774481edac5bbba7e25b3237799402c0bba2599 /FuseArchive
parente3f46ccfb21bb988e2649a6c54daba9dec2c9a03 (diff)
downloadfusearchive-7f8c15ebab3a2ebe8d2929f1b3e5abb160866b57.zip
fusearchive-7f8c15ebab3a2ebe8d2929f1b3e5abb160866b57.tar.gz
fusearchive-7f8c15ebab3a2ebe8d2929f1b3e5abb160866b57.tar.bz2
Truncate files on unlink so we free their blocks
Diffstat (limited to 'FuseArchive')
-rw-r--r--FuseArchive/FileSystem.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/FuseArchive/FileSystem.py b/FuseArchive/FileSystem.py
index b393dbb..e70bba6 100644
--- a/FuseArchive/FileSystem.py
+++ b/FuseArchive/FileSystem.py
@@ -47,6 +47,10 @@ class FileSystem(fuse.Fuse):
yield fuse.Direntry(e)
def unlink(self, path):
+ # Do a truncate to free our chunks
+ f = ChunkFile( path, os.O_RDWR, 0 )
+ f.truncate( 0 )
+ f.release( 0 )
os.unlink("./tree" + path)
def rmdir(self, path):