list_files(
dir,pattern,mode,resolve_links) ->files,err
List files in a directory matching a pattern and mode
Returns a table keyed by filename, with each value containing
mode, size, perms, uid, gid, atime, and optionally
target fields. Default pattern is ^.*, default mode is "f".