bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] canonicalize.c and realpath


From: Paul Eggert
Subject: Re: [bug-gnulib] canonicalize.c and realpath
Date: Mon, 04 Apr 2005 10:15:32 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

address@hidden (Eric Blake) writes:

> Should we also add a realpath module to provide realpath on systems
> that don't have it?

That sounds reasonable.  canonicalize could then use it.

Any gnulib realpath should support a 2nd argument being NULL, and
should malloc the path in that case, even on systems where the native
realpath doesn't support this common extension to POSIX.  This will
simplify usage.

Also, gnulib realpath shouldn't have the property that SunOS 5.5.1
realpath does -- this implementation uses chdir() and can fail to
return to the current directory if an error occurs.  That's a real
no-no.

Ideally, gnulib realpath should also do the right thing even if the
system realpath would fail and return ENAMETOOLONG due to the result
being too long.  This may be a bit harder to arrange reliably, though.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]