chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Posix "realpath"


From: John Cowan
Subject: Re: [Chicken-users] Posix "realpath"
Date: Sun, 1 Apr 2012 13:13:06 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

Matt Welland scripsit:

> Please consider adding realpath to posix. If I understand correctly
> realpath is a specified part of posix and thus would quite naturally fit
> into the posix unit. 

I agree; having it is a Good Thing, and it's quite portable as well as
being part of POSIX.1-2001 and later.  Unfortunately, there is no Win32
equivalent; it probably should signal an error on Windows rather than
returning an unreliable result.  (It is available in Cygwin.)

Note that the only safe way to use realpath() is to pass NULL as the
second argument, and free() the returned result.  Otherwise you risk
passing a too-small buffer, with the usual bad consequences, and there is
no reliable way to find out how big the buffer ought to be (in particular
PATH_MAX does not work reliably).

-- 
Not to perambulate                 John Cowan <address@hidden>
    the corridors                  http://www.ccil.org/~cowan
during the hours of repose
    in the boots of ascension.       --Sign in Austrian ski-resort hotel



reply via email to

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