To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: How to obtain full path name From: alane AT wozzle DOT linet DOT org (J. Alan Eldridge) Date: Wed, 10 Mar 93 22:05:00 EST Organization: Disorganization Eric Backus writes: > I believe that the POSIX answer is: > > #include > > char *getcwd(char *buf, size_t size); > > You pass it a buffer of size bytes, and getcwd() fills in > the buffer with the current working directory, and then returns . > If something fails (like is too small) the function returns > NULL and sets errno. I believe that PATH_MAX bytes should always be > big enough to hold the path. Or maybe you need PATH_MAX+1 for the > null. I can't remember. Also, if passed a NULL pointer it allocates space on the heap, which the caller is responsible for freeing. alane AT wozzle DOT linet DOT org (J. Alan Eldridge) Fido: The University of Woolloomooloo 1:272/38.473