Mercurial > prosody-hg
diff util/datamanager.lua @ 6690:b2e89583d6e6
Merge 0.10->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 13 May 2015 22:33:40 +0200 |
| parents | 0217a04722c7 |
| children | 5de6b93d0190 67ac4a0b6e50 |
line wrap: on
line diff
--- a/util/datamanager.lua Wed May 13 17:00:27 2015 +0100 +++ b/util/datamanager.lua Wed May 13 22:33:40 2015 +0200 @@ -348,8 +348,12 @@ function purge(username, host) local host_dir = format("%s/%s/", data_path, encode(host)); + local ok, iter, state, var = pcall(lfs.dir, host_dir); + if not ok then + return ok, iter; + end local errs = {}; - for file in lfs.dir(host_dir) do + for file in iter, state, var do if lfs.attributes(host_dir..file, "mode") == "directory" then local store = decode(file); local ok, err = do_remove(getpath(username, host, store));
