www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/05/05/17:34:04

Date: Wed, 5 May 1999 23:06:38 +0200
From: Frank Heckenbach <frank AT tim DOT gerwinski DOT de>
Message-Id: <21E03C02.19990505230638.FOO-3FD0.frank@goedel.fjf.gnu.de>
X-Mailer: smtphack 0.3.3 by Jan Andres
To: djgpp-workers AT delorie DOT com
Subject: realpath()
Reply-To: djgpp-workers AT delorie DOT com

Hi,

do you plan to support the realpath() function? Though it's not part
of POSIX, AFAIK, many Unix systems have it (e.g. Linux in
<unistd.h>, Solaris and Irix in <stdlib.h>).

I think it would be quite useful for DJGPP because of the problems
with drive letters. AFAICS, the _fixpath() function is functionally
mostly equivalent, but the underscore suggests that it's not meant
for use from normal programs!?

So, I think it should be easy to implement realpath() on top of
_fixpath(). The header of realpath() is

       char *realpath(char *path, char resolved_path[]);

where path is the input path which is not modified, and
resolved_path is a buffer for the result, which is returned when
there is no error. Otherwise it returns a NULL pointer and places in
resolved_path the absolute pathname of the path component which
could not be resolved. The global variable errno is set to indicate
the error.

Frank

PS: I'm not subscribed, so please CC any answers. Thanks.

-- 
Frank Heckenbach, frank AT fjf DOT gnu DOT de
http://fjf.gnu.de/
PGP and GPG keys: http://fjf.gnu.de/plan

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019