Merge pull request #141 from moutonjr/pv-remove-lua-bug-cd

Fixed: bug serving files because of LUA exception
This commit is contained in:
Alexandre Aubin 2019-08-18 14:18:48 +02:00 committed by GitHub
commit 07e8a292f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -317,10 +317,8 @@ end
-- --
function scandir(directory, callback) function scandir(directory, callback)
-- FIXME : this sometime fails (randomly...)
-- because of 'interrupted system call'
-- use find (and not ls) to list only files recursively and with their full path relative to the asked directory -- use find (and not ls) to list only files recursively and with their full path relative to the asked directory
local pfile = io.popen('cd "'..directory..'" && find * -type f') local pfile = io.popen('find "'..directory..'" -type f')
for filename in pfile:lines() do for filename in pfile:lines() do
callback(filename) callback(filename)
end end