Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../sbin/../man/man3gen/mkdirp.3gen
Real path: /usr/share/man/man3gen/mkdirp.3gen
Zurück
'\" te .\" Copyright (c) 1989, AT&T. All rights reserved. .\" Copyright (c) 2003, 2020, Oracle and/or its affiliates. .TH mkdirp 3GEN "14 Oct 2003" "Oracle Solaris 11.4" "String Pattern-Matching Library Functions" .SH NAME mkdirp, rmdirp \- create or remove directories in a path .SH SYNOPSIS .LP .nf cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lgen\fR [ \fIlibrary\fR ... ] #include <libgen.h> \fBint\fR \fBmkdirp\fR(\fBconst char *\fR\fIpath\fR, \fBmode_t\fR \fImode\fR); .fi .LP .nf \fBint\fR \fBrmdirp\fR(\fBchar *\fR\fIdir\fR, \fBchar *\fR\fIdir1\fR); .fi .SH DESCRIPTION .sp .LP The \fBmkdirp()\fR function creates all the missing directories in \fIpath\fR with \fImode\fR. See \fBchmod\fR(2) for the values of \fImode\fR. .sp .LP The \fBrmdirp()\fR function removes directories in path \fIdir\fR. This removal begins at the end of the path and moves backward toward the root as far as possible. If an error occurs, the remaining path is stored in \fIdir1\fR. .SH RETURN VALUES .sp .LP If \fIpath\fR already exists or if a needed directory cannot be created, \fBmkdirp()\fR returns \fB\(mi1\fR and sets \fBerrno\fR to one of the error values listed for \fBmkdir\fR(2). It returns zero if all the directories are created. .sp .LP The \fBrmdirp()\fR function returns \fB0\fR if it is able to remove every directory in the path. It returns \fB\(mi2\fR if a '\fB.\fR' or '\fB..\fR' is in the path and \fB\(mi3\fR if an attempt is made to remove the current directory. Otherwise it returns \fB\(mi1\fR. .SH EXAMPLES .LP \fBExample 1\fR Example of creating scratch directories. .sp .LP The following example creates scratch directories. .sp .in +2 .nf /* create scratch directories */ if(mkdirp("/tmp/sub1/sub2/sub3", 0755) == \(mi1) { fprintf(stderr, "cannot create directory"); exit(1); } chdir("/tmp/sub1/sub2/sub3"); \&. \&. \&. /* cleanup */ chdir("/tmp"); rmdirp("sub1/sub2/sub3"); .fi .in -2 .sp .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 \fBchmod\fR(2), \fBmkdir\fR(2), \fBrmdir\fR(2), \fBmalloc\fR(3C), \fBattributes\fR(7) .SH NOTES .sp .LP The \fBmkdirp()\fR function uses \fBmalloc\fR(3C) to allocate temporary space for the string.