I also remember that I looked in the whole Emacs source tree (Lisp
part only, though) to see if the numerical id is ever actually used.
It turned out that what the code really wants is the user name.
That's what I remember as well.
I think we should simply switch to user-names, but if compatibility
is a problem, we can just provide an additional argument to select
between the two behaviors.
I have done some searching in the source tree myself now. There are no problems
in the C code, but in the lisp code I have found more that 10 files that
expects UID to be numeric. It may be true that all of them can be changed
to use names rather than ids, but it requires more work than I can handle
myself. Therefore I suggest we introduce an additional argument to file-attributes
and directory-files-and-attributes.