summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/fs.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/fs.lua b/lib/fs.lua
index c9094f2..e7643df 100644
--- a/lib/fs.lua
+++ b/lib/fs.lua
@@ -79,6 +79,14 @@ function write_line_file ( path, str )
end
+--will return a string with md5sum and filename
+function md5sum_file ( path )
+ cmd = "/usr/bin/md5sum " .. path
+ f = io.popen(cmd)
+ checksum = f:read("*a")
+ f:close()
+ return checksum
+end
-- iterator function for finding dir entries matching filespec (what)