From 2c73e4165909bc0d82cc62a9031bd687a5e000b6 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 9 Feb 2014 13:57:49 +0100 Subject: [log] use UUID instead of MD5(time) when creating log files --- luaotfload-log.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/luaotfload-log.lua b/luaotfload-log.lua index 938050a..d057eb3 100644 --- a/luaotfload-log.lua +++ b/luaotfload-log.lua @@ -19,9 +19,9 @@ local ioopen = io.open local iowrite = io.write local lfsisdir = lfs.isdir local lfsisfile = lfs.isfile -local md5sumhexa = md5.sumhexa local osdate = os.date local ostime = os.time +local osuuid = os.uuid local select = select local stringformat = string.format local stringsub = string.sub @@ -75,9 +75,7 @@ local choose_logfile = function ( ) if lfsisdir (tmppath) then local fname repeat --- ensure that file of that name doesn’t exist - --- TODO this could use os.uuid() instead of md5 - fname = tmppath .. "/luaotfload-log-" - .. stringsub (md5sumhexa (ostime ()), 1, 8) + fname = tmppath .. "/luaotfload-log-" .. osuuid() until not lfsisfile (fname) iowrite (stringformat (log_msg, fname, fname)) return ioopen (fname, "w") -- cgit v1.2.3