diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-09 13:57:49 +0100 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-09 13:57:49 +0100 |
commit | 2c73e4165909bc0d82cc62a9031bd687a5e000b6 (patch) | |
tree | a997cddfefbeb6aeac9a0fd724fea1e22f812999 /luaotfload-log.lua | |
parent | 4ec63fd11536844ed53c16006ac37a33623e61e8 (diff) | |
download | luaotfload-2c73e4165909bc0d82cc62a9031bd687a5e000b6.tar.gz |
[log] use UUID instead of MD5(time) when creating log files
Diffstat (limited to 'luaotfload-log.lua')
-rw-r--r-- | luaotfload-log.lua | 6 |
1 files 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") |