From f8fd2c3a541d9d0cc8a093facc0ed0abf317527c Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 16 May 2013 01:40:21 +0300 Subject: beta 2013.05.16 00:29 --- tex/context/base/l-file.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'tex/context/base/l-file.lua') diff --git a/tex/context/base/l-file.lua b/tex/context/base/l-file.lua index acb4216b0..f25490749 100644 --- a/tex/context/base/l-file.lua +++ b/tex/context/base/l-file.lua @@ -62,7 +62,7 @@ elseif not lfs.isfile then end local insert, concat = table.insert, table.concat -local match, find = string.match, string.find +local match, find, gmatch = string.match, string.find, string.gmatch local lpegmatch = lpeg.match local getcurrentdir, attributes = lfs.currentdir, lfs.attributes local checkedsplit = string.checkedsplit @@ -572,3 +572,19 @@ end -- return f(...) -- end -- end + +-- a goodie: a dumb version of mkdirs: + +function lfs.mkdirs(path) + local full + for sub in gmatch(path,"([^\\/]+)") do + if full then + full = full .. "/" .. sub + else + full = sub + end + if not lfs.isdir(full) then + lfs.mkdir(full) + end + end +end -- cgit v1.2.3