diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-09 19:22:40 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-09 19:22:46 -0700 |
| commit | de34592dbebfa8882f495694d73f2a8b1e2d0856 (patch) | |
| tree | 67141893c161e24c4e8722a77f2e2b7d9e73963f /files.lua | |
| parent | 0d70332ccf8737fd8cde8eedda034a87184d0486 (diff) | |
Adding some compatibility stuff.
Diffstat (limited to 'files.lua')
| -rw-r--r-- | files.lua | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -59,7 +59,7 @@ if ok then local raw_file_exists raw_file_exists = function(filename) local mode = lfs.attributes(filename, 'mode') - if mode == 'file' or mode == 'directory' then + if mode == 'file' or mode == 'directory' or mode == 'link' then return true else return false @@ -80,15 +80,15 @@ if ok then end local browse browse = function(filename) - local file_type = lfs.attributes(filename, 'mode') + local file_type, err = lfs.attributes(filename, 'mode') if file_type == 'file' then if match(filename, "%.nom$") or match(filename, "%.lua$") then coroutine.yield(filename) return true end - elseif file_type == 'directory' then + elseif file_type == 'directory' or file_type == 'link' then for subfile in lfs.dir(filename) do - if not (subfile == "." or subfile == ".." or not subfile:match("%.nom$")) then + if not (subfile == "." or subfile == "..") then browse(filename .. "/" .. subfile) end end |
