From: Alain Magloire Message-Id: <199905111814.OAA22310@mccoy2.ECE.McGill.CA> Subject: Re: realpath() To: djgpp-workers AT delorie DOT com Date: Tue, 11 May 1999 14:14:31 -0400 (EDT) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Bonjour > It should be easy to add a simple wrapper around _fixpath. Volunteers > are welcome : Here is a crude workaround. ------------- #include char * realpath (const char *, char *); -------------------------------- #include #include #include #include char * realpath (const char * file_name, char * resolved_name) { struct stat stbuf; if (file_name == NULL || resolved_name == NULL) { errno = EINVAL; return 0; } if (*file_name == '\0') { errno = ENOENT; return 0; } if (stat(file_name, &stbuf) != 0) return 0; _fixpath (file_name, resolved_name); return resolved_name; } -------------------------------- The big difference with _fixpath is that it actually check for the path existence. -- au revoir, alain ---- Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!