GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
REL2ABS(3) FreeBSD Library Functions Manual REL2ABS(3)

rel2abs
make an absolute path name from a relative path name

char *
rel2abs(const char *path, const char *base, char *result, size_t size);

The rel2abs() function makes an absolute path name from a relative path name path based on a directory base and copies the resulting path name into the memory referenced by result. The result argument must refer to a buffer capable of storing at least size character

The resulting path name may include symbolic links. abs2rel() doesn't check whether or not any path exists.

The rel2abs() function returns absolute path name on success. If an error occurs, it returns NULL.

The rel2abs() function may fail and set the external variable errno to indicate the error.
[]
The base directory isn't an absolute path name or the size argument is zero.
[]
The size argument is greater than zero but smaller than the length of the pathname plus 1


char result[MAXPATHLEN];
char *path = rel2abs("../../src/sys", "/usr/local/lib", result, MAXPATHLEN);

yields:


path == "/usr/src/sys"

Similarly,


path1 = rel2abs("src/sys", "/usr", result, MAXPATHLEN);
path2 = rel2abs(".", "/usr/src/sys", result, MAXPATHLEN);

yields:


path1 == "/usr/src/sys"
path2 == "/usr/src/sys"

abs2rel(3)

Shigio Yamaguchi (shigio@tamacom.com)
Dec 3, 1997" FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.