lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Jan 18, 2010 at 6:12 PM, RJP Computing <rjpcomputing@gmail.com> wrote:
> Any update on this? Just kind of getting close to needing this
> functionality.

Weirdly broken, this one. This seems to do the job:

function _makepath(p)
   if not path.isdir(p) then
    local subp = p:match(dirpat)
    if not _makepath(subp) then return false end
    return lfs.mkdir(p)
   else
    return true
   end
end

function makepath (p)
    return _makepath(path.normcase(path.abspath(p)))
end

That is, it's necesary to start with the full path, and work with
that. Tested on Windoze, should work on the other side!

steve d.