From 83eeef4b067b7182778581c9fdfb104492647bd4 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 17 Sep 2001 15:16:09 +0000 Subject: SF patch #461781 by Chris Lawrence: os.path.realpath - Resolve symlinks: Once upon a time, I put together a little function that tries to find the canonical filename for a given pathname on POSIX. I've finally gotten around to turning it into a proper patch with documentation. On non-POSIX, I made it an alias for 'abspath', as that's the behavior on POSIX when no symlinks are encountered in the path. Example: >>> os.path.realpath('/usr/bin/X11/X') '/usr/X11R6/bin/X' --- Lib/macpath.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Lib/macpath.py') diff --git a/Lib/macpath.py b/Lib/macpath.py index 46ae76488e..1ef35ef11b 100644 --- a/Lib/macpath.py +++ b/Lib/macpath.py @@ -225,3 +225,6 @@ def abspath(path): if not isabs(path): path = join(os.getcwd(), path) return normpath(path) + +# realpath is a no-op on systems without islink support +realpath = abspath -- cgit v1.2.1