Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../.././../../../usr/man/man3gen/pathfind.3gen
Real path: /usr/share/man/man3gen/pathfind.3gen
Zurück
'\" te .\" Copyright (c) 1989, AT&T. All rights reserved. .\" Portions Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. .TH pathfind 3GEN "14 May 2014" "Oracle Solaris 11.4" "String Pattern-Matching Library Functions" .SH NAME pathfind \- search for named file in named directories .SH SYNOPSIS .LP .nf cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lgen\fR [ \fIlibrary\fR ... ] #include <libgen.h> \fBchar *\fR\fBpathfind\fR(\fBconst char *\fR\fIpath\fR, \fBconst char *\fR\fIname\fR, \fBconst char *\fR\fImode\fR); .fi .SH DESCRIPTION .sp .LP The \fBpathfind()\fR function searches the directories named in \fIpath\fR for the file \fIname\fR. The directories named in \fIpath\fR are separated by colons (:). The \fImode\fR argument is a string of option letters chosen from the set \fB[rwxfbcdpugks]:\fR .sp .TS tab( ) box; lw(2.75i) |lw(2.75i) lw(2.75i) |lw(2.75i) . Letter Meaning _ \fBr\fR readable _ \fBw\fR writable _ \fBx\fR executable _ \fBf\fR normal file _ \fBb\fR block special _ \fBc\fR character special _ \fBd\fR directory _ \fBp\fR FIFO (pipe) _ \fBu\fR set user ID bit _ \fBg\fR set group ID bit _ \fBk\fR sticky bit _ \fBs\fR size non-zero .TE .sp .sp .LP Options read, write, and execute are checked relative to the real (not the effective) user \fBID\fR and group \fBID\fR of the current process. .sp .LP If \fIname\fR begins with a slash, it is treated as an absolute path name, and \fIpath\fR is ignored. .sp .LP An empty \fIpath\fR member is treated as the current directory. A slash (\fB/\fR) character is not prepended at the occurrence of the first match; rather, the unadorned \fIname\fR is returned. .SH EXAMPLES .LP \fBExample 1\fR Example of finding the \fBls\fR command using the PATH environment variable. .sp .LP To find the \fBls\fR command using the \fBPATH\fR environment variable: .sp .LP pathfind (getenv ("PATH"), "ls", "rx") .SH RETURN VALUES .sp .LP The \fBpathfind()\fR function returns a \fB(char *)\fR value containing static, thread-specific data that will be overwritten upon the next call from the same thread. .sp .LP If the file \fIname\fR with all characteristics specified by \fImode\fR is found in any of the directories specified by \fIpath\fR, then \fBpathfind()\fR returns a pointer to a string containing the member of \fIpath\fR, followed by a slash character (\fB/\fR), followed by \fIname\fR. .sp .LP If no match is found, \fBpathname()\fR returns a null pointer, \fB((char *) 0)\fR. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ MT-Level MT-Safe .TE .sp .SH SEE ALSO .sp .LP \fBsh\fR(1), \fBtest\fR(1), \fBaccess\fR(2), \fBmknod\fR(2), \fBstat\fR(2), \fBgetenv\fR(3C), \fBattributes\fR(7) .SH NOTES .sp .LP The string pointed to by the returned pointer is stored in an area that is reused on subsequent calls to \fBpathfind()\fR. The string should not be deallocated by the caller.