X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=ioncore%2Fioncore_wd.lua;h=b00b18daffcfeacbddb09476403ee9ee7dc28325;hp=d69a9eb1fc01f0170bc9f36d3bef9832686ea241;hb=HEAD;hpb=720e6978185b09f2b2f60a6b96018238085a7238 diff --git a/ioncore/ioncore_wd.lua b/ioncore/ioncore_wd.lua index d69a9eb..b00b18d 100644 --- a/ioncore/ioncore_wd.lua +++ b/ioncore/ioncore_wd.lua @@ -1,33 +1,26 @@ -- -- ion/share/ioncore_wd.lua -- --- Copyright (c) Tuomo Valkonen 2004-2007. +-- Copyright (c) Tuomo Valkonen 2004-2009. -- -- See the included file LICENSE for details. -- local savefile="saved_wd" local dirs={} -local px +local lfs -if pcall(function() return require('posix') end) then - px=posix +if pcall(function() return require('lfs') end) then + lfs=_G["lfs"] end local function checkdir(d) - if not px then + if not lfs then return true else - local t, err=px.stat(d, "type") + local t, err=lfs.attributes(d, "mode") if not t then return nil, err - elseif t=="link" then - local d2, err=px.readlink(d) - if not d2 then - return nil, err - else - return checkdir(d2) - end elseif t=="directory" then return true else