Skip to content

dirtree and getallfiles don't check permissions #494

@RunningDroid

Description

@RunningDroid

If dirtree or getallfiles come across a directory they don't have permission to read they throw a stack trace instead of skipping it.

Example:

dir=require('pl.dir')
path=require('pl.path')
path.mkdir('unreadable')
os.execute('chmod -xr unreadable')
return dir.dirtree('unreadable')

the output:

...home/runningdroid/.luarocks/share/lua/5.1/pl/dir.lua:496: cannot open unreadable: Permission denied
stack traceback:
	[C]: in function 'ldir'
	...home/runningdroid/.luarocks/share/lua/5.1/pl/dir.lua:496: in function <...home/runningdroid/.luarocks/share/lua/5.1/pl/dir.lua:488>
	(tail call): ?
	[C]: ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions