On Thu, Jul 15, 2010 at 12:59 AM, Faré <fahree@gmail.com> wrote:
we use TRUENAME + HANDLER-CASE precisely because the file (or
directory, most of the time) doesn't necessarily exist and we're
trying to fully resolve any symlinks along the path, so that in the
end we may apply translations to normalized pathnames.
But Rene, (ignore-errors (return (truename p))) = (probe-file p) with the difference that the latter can be implemented much more efficiently.
TRUENAME has a cost that is proportional to the number of directory components and to this you must add the cost of establishing a handler-bind and the jump outside the function due to the error.
PROBE-FILE first probes the existence of the file, which can be done with a *single* system call. No error handling is required: if the file does not exist, nothing else is done, but if the file exists, then its truename is returned -- as per TRUENAME, with symlinks resolved.
Am I missing something?
Juanjo
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com