diff options
author | Marius <mariausol@gmail.com> | 2013-05-16 01:40:21 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-05-16 01:40:21 +0300 |
commit | f8fd2c3a541d9d0cc8a093facc0ed0abf317527c (patch) | |
tree | 6e742c191b8d5079ca565c2b60687397807e5d37 /tex/context/base/l-file.lua | |
parent | af60db62dbf468522f21a4ad4461f1a505d8161c (diff) | |
download | context-f8fd2c3a541d9d0cc8a093facc0ed0abf317527c.tar.gz |
beta 2013.05.16 00:29
Diffstat (limited to 'tex/context/base/l-file.lua')
-rw-r--r-- | tex/context/base/l-file.lua | 18 |
1 files changed, 17 insertions, 1 deletions
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 |