getwd(3) Library Functions Manual getwd(3)Name
getwd - get current working directory pathname
Syntax
char *getwd(pathname)
char *pathname;
Description
The subroutine copies the absolute pathname of the current working directory to pathname and returns a pointer to the result.
Restrictions
The subroutine may fail to return to the current directory if an error occurs.
Pathnames can be no longer than MAXPATHLEN as defined in <sys/param.h>.
Return Values
The subroutine returns zero and places a message in pathname if an error occurs.
getwd(3)
Check Out this Related Man Page
getwd(3C) Standard C Library Functions getwd(3C)NAME
getwd - get current working directory pathname
SYNOPSIS
#include <unistd.h>
char *getwd(char *path_name);
DESCRIPTION
The getwd() function determines an absolute pathname of the current working directory of the calling process, and copies that pathname into
the array pointed to by the path_name argument.
If the length of the pathname of the current working directory is greater than (PATH_MAX + 1) including the null byte, getwd() fails and
returns a null pointer.
RETURN VALUES
Upon successful completion, a pointer to the string containing the absolute pathname of the current working directory is returned. Other-
wise, getwd() returns a null pointer and the contents of the array pointed to by path_name are undefined.
ERRORS
No errors are defined.
USAGE
For portability to implementations conforming to versions of the X/Open Portability Guide prior to SUS, getcwd(3C) is preferred over this
function.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO getcwd(3C), attributes(5), standards(5)SunOS 5.10 24 Jul 2002 getwd(3C)
Hello all,
I have successfully installed samba 3.0.22 on my sol 9 e250 machine. I created my share but when i try to get to my share from my windows machine, it prompts me for my username and passwd, i enter it and it just comes back prompting me for my username and passwd agai,. Has anyone been... (8 Replies)
We are moving from old solaris to new version of solaris. I have copied the gcc compiler installed on old server to new solaris server. But just copying didn't work. So I am trying to build it on the new server. The server version is
sailfish@st-kvar02 -> uname -a
SunOS st-kvar02 5.10... (7 Replies)
Hi, i have a question is there any way to store a system call (like pwd, or the path of a working directory) to a variable using C?? or is there another way that i can obtain the PATH??, and how can i use the same var to do a cd or make a file.
thank you in advance!! (1 Reply)
Hi Unix Gurus,
I would like to seek some advises regarding tar. I've received this error:
tar: The getwd subroutine failed.
Cannot open the parent directory.
when i try to tar some files in the directory.
Is this something to do with the file permission of the parent... (8 Replies)
Hello!
I have an ESX Server up and running. Now I want to connect a serial device to the COM Port. For that I need the minicom program.
When I try "configure - make - make all" I get some errors. Can someone please explain to me, what the problems are:
# ./configure
checking for a... (3 Replies)
Hi All, We are using solaris samba server for our company project to provide access to code to our development team.Recently our ICT has disabled wins service on Active directory due which user are not able to connect to samba share and they are getting error "No logon server available" as samba... (2 Replies)