003
13.05.2007, 12:05 Uhr
Pler
Einer von Vielen (Operator)
|
ja. 
Auf den Rechnern in der Uni kommt man mit man getcwd auch direkt zum Richtigen. Nur bei mir gibts noch die andere Version. Aber da steht auch, dass es die eigentlich gar nicht gibt und man man 3 getcwd nehmen soll. Aber so genau hab ichs erst mal wieder nicht gelesen.
man: |
GETCWD(2) Linux Programmer’s Manual GETCWD(2)
NAME getcwd - get current working directory
SYNOPSIS /* * This page documents the getcwd(2) system call, which * is not defined in any user-space header files; you should * use getcwd(3) defined in <unistd.h> instead in applications. */
long getcwd(char *buf, unsigned long size);
DESCRIPTION The getcwd() function copies an absolute pathname of the current work- ing directory to the array pointed to by buf, which is of length size.
If the current absolute path name would require a buffer longer than size elements, -1 is returned, and errno is set to ERANGE; an applica- tion should check for this error, and allocate a larger buffer if nec- essary.
If buf is NULL, the behaviour of getcwd() is undefined.
RETURN VALUE -1 on failure (for example, if the current directory is not readable), with errno set accordingly, and the number of characters stored in buf on success. The contents of the array pointed to by buf is undefined on error.
Note that this return value differs from the getcwd(3) library func- tion, which returns NULL on failure and the address of buf on success.
|
|