About a year ago I added the parameter id-format to the primitives file-attributes and directory-files-and-attributes so that one can get uid and gid as a string. I did that primarily because I like ls-lisp very much and would like to use it together with tramp. However, ls-lisp uses directory-files-and-attributes and tramp does not implement it. I never got around to do anything about that, but now I finally have made a patch (attached). Please take a look at it before I install it. Thank you! Description of changes: 1. New function tramp-handle-directory-files-and-attributes with perl script tramp-perl-directory-files-and-attributes. In order to not slow down login process, the script is sent only if needed. A new function tramp-maybe-send-perl-script handles that. Connection property "perl-scripts" holds a list of scripts sent. With tramp-maybe-send-perl-script it is easy for a user to implement his own "remote procedure" with perl. 2. tramp-handle-file-attributes-with-perl now uses tramp-maybe-send-perl-script, the script is no longer sent by tramp-post-connection. This should speed up initialization a bit. 3. Conversion of file mode bits to a string and and assignment of virtual device number is collected a new function tramp-convert-file-attributes. This function also adds tramp prefix to symlinks if they are absolute -- that was not done before. tramp-convert-file-attributes is used in tramp-handle-file-attributes and tramp-handle-directory-files-and-attributes. 4. tramp-perl-file-attributes did not surround uid and gid by double quotes when they were supposed to be a string. That is corrected. 5. Name and semantics of parameter nonnumeric is changed to id-format in functions tramp-perl-file-attributes, tramp-handle-file-attributes-with-perl and tramp-handle-file-attributes-with-ls. 6. tramp-handle-insert-directory now runs the real handler when ls-lisp is in use. 7. file-directory-files is deleted from tramp-file-name-handler-alist, there is no such primitive and no tramp handler. So I guess it is a mistake.