|
From: | Michael Albinus |
Subject: | Re: Patch: use GNU readlink --canonicalize for file-truename when available |
Date: | Fri, 14 Aug 2009 09:23:39 +0200 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Julian Scheid <address@hidden> writes: > Unfortunately, neither readlink --canonicalize nor the perl script > work reliably: > > (file-truename "/does/not/exist") > "/does/not/exist" > > $ perl -e 'use Cwd "realpath"; print realpath("/does/not/exist");' > $ # empty > > $ readlink --canonicalize /does/not/exist > $ # empty What about this: $ perl -e 'use Cwd "realpath"; (-e "/does/not/exist") ? print realpath("/does/not/exist") : print "/does/not/exist"; print "\n"' /does/not/exist $ readlink --canonicalize-missing /does/not/exist /does/not/exist $ ll /tmp/xxx lrwxrwxrwx 1 albinus smc3 13 08-14 09:20 /tmp/xxx -> /home/albinus/ perl -e 'use Cwd "realpath"; (-e "/tmp/xxx") ? print realpath("/tmp/xxx") : print "/tmp/xxx"; print "\n"' /home/albinus $ readlink --canonicalize-missing /tmp/xxx /home/albinus Best regards, Michael.
[Prev in Thread] | Current Thread | [Next in Thread] |