3 .ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
4 .if !
\a\\$4
\a\a .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
7 .ie
\a\\$3
\a\a .ft \\$1
11 .Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
16 .aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
19 .aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
22 .aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
24 .de EX \" start example
41 path \- file path routines
46 char* pathaccess(char* \fIpath\fP, const char* \fIdirs\fP, const char* \fIa\fP, const char* \fIb\fP, int \fImode\fP);
48 char* pathcanon(char* \fIpath\fP, int \fIflags\fP);
49 char* pathcat(char* \fIpath\fP, const char* \fIdirs\fP, int \fIsep\fP, const char* \fIa\fP, const char* \fIb\fP);
50 char* pathcd(char* \fIpath\fP, const char* \fIhome\fP);
51 int pathcheck(const char* \fIpackage\fP, const char* \fItool\fP, Pathcheck_t* \fIpc\fP);
52 int pathgetlink(const char* \fIname\fP, char* \fIbuf\fP, int \fIsiz\fP);
53 char* pathkey(char* \fIkey\fP, char* \fIattr\fP, const char* \fIlang\fP, const char* \fIpath\fP);
54 char* pathnext(char* \fIpath\fP, char* \fIextra\fP, long* \fIvisits\fP);
55 char* pathpath(char* \fIpath\fP, const char* \fIp\fP, const char* \fIa\fP, int \fImode\fP);
56 char* pathprobe(char* \fIpath\fP, char* \fIattr\fP, const char* \fIlang\fP, const char* \fItool\fP, const char* \fIproc\fP, int \fIop\fP);
57 char* pathrepl(char* \fIpath\fP, const char* \fImatch\fP, const char* \fIreplace\fP);
58 int pathsetlink(const char* \fItext\fP, char* \fIname\fP);
59 char* pathshell(void);
60 int pathstat(const char* \fIpath\fP, struct stat* \fIst\fP);
61 char* pathtemp(char* \fIpath\fP, const char* \fIdir\fP, const char* \fIpfx\fP);
64 These routines operate on file path names.
65 Path buffers are assumed to be of size
70 even if it indeterminant on the local system.
71 Yes, this was probably a bad choice, but it was made about 10 years ago.
72 We will probably move to a <stk.h> based implementation.
83 separated directories in
92 is the inclusive-or of:
98 Read permission on file.
101 Write permission on file.
104 Execute permission on file.
110 Generated path name is rooted at
113 is returned, 0 on error.
116 returns a pointer to the
118 separated list of directories to search for executable commands.
121 environment variable is first consulted.
123 .L confstr(_CS_PATH,...)
125 A valid string is always returned.
128 canonicalizes the path
131 A pointer to the trailing 0 in the canonicalized path is returned.
132 A canonical path has:
141 preserved for super root hacks;
146 .I flags is the inclusive-or of:
151 is checked for access.
154 Path must exist at each component.
157 Symbolic links are resolved at each component.
159 0 is returned on error.
160 If an error occurs and either of
166 will contain the components following the failure point.
169 concatenates the first
171 separated path component in
173 with the path components
179 The path is constructed in
181 by separating each path component with
189 A pointer to the next
191 separated component in
195 when there are no more components.
201 sets the current working directory to
209 then it is split up into a sequence of relative paths and
211 is called on each of these.
212 For any given system, if you got to a directory, then
214 can get you back, modulo permission and link changes.
217 is a stub for license libraries.
222 returns the 0-terminated symbolic link text for
228 The link text length is returned on success, \-1 on error.
231 interactions with dynamic symbolic links are handled
232 by converting non-standard dynamic link text to
233 .LI .../$( UNIVERSE )/...
235 converts in the other direction.
240 a 14 character lookup key (plus terminating 0) for the language
244 A poihter to the key is returned, 0 on error.
247 then space is allocated via
249 Key specific attribute
251 pairs are copied into
265 using the directories from
274 environment variable (set by
276 are used for related root searching.
288 the full path name of the
292 information file for the
298 then space is allocated via
302 pairs are copied into
310 return the path name with no access checks or generation
313 message emitted information must be generated via
317 no message emitted information must be probed via
320 0 is returned if the information does not exist and cannot be generated.
323 does an in-place replacement of the first occurrence of
331 creates a symbolic link
339 interactions hidden by this routine.
342 returns a pointer to the pathname for the shell for the current process.
345 environment variable is first consulted, but is rejected under suspicious
346 ownership/setuid conditions of if it seems to point to
349 .L confstr(_CS_SHELL,...)
351 A valid string is always returned.
356 and if that fails it tries
357 .LI lstat( path,st ).
362 return value is returned.
367 a temporary file path name of the form
368 .I dir/pfx<pid>.<suf>
371 if !=0, is limited to 5, the length of
373 (the base 64 representation of the current process id)
376 (an internally generated suffix that avoid file confilicts)
378 The generated path name conforms to the classic UNIX 14 char and the DOS
388 is used to avoid file conflicts but the generated path name is not created,
389 so you could lose in a race.
391 3d(1), access(2), confstr(3), fs3d(3), lstat(2), stat(2)