mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-12-21 23:29:16 +00:00
91 lines
2.0 KiB
Groff
91 lines
2.0 KiB
Groff
.\" This man page was written to conform with the lenviron v1.1.3
|
|
.\" release for Gno v2.0.3 and later by Devin Reade.
|
|
.\"
|
|
.\" $Id: isRootPath.3,v 1.1 1997/02/27 07:32:23 gdr Exp $
|
|
.\"
|
|
.TH ISROOTPATH 3 "30 January 1997" GNO "Library Routines"
|
|
.SH NAME
|
|
isRootPath - test for a full pathname
|
|
.SH SYNOPSIS
|
|
#include <gno/gno.h>
|
|
|
|
int \fBisRootPath\fR (const char *\fIname\fR);
|
|
.SH DESCRIPTION
|
|
.BR isRootPath
|
|
tests the string
|
|
.IR name
|
|
to see if it is the full specification of a path name to a file starting
|
|
at the root of the file system. Under GS/OS,
|
|
.IR name
|
|
is tested to see if it is a legal volume name, device name, or prefix.
|
|
Therefore,
|
|
.IR name
|
|
is considered to be a full pathname when:
|
|
.RS
|
|
.sp
|
|
It starts with either
|
|
.B /
|
|
or
|
|
.B :
|
|
and is at least two characters long;
|
|
.sp
|
|
It starts with either
|
|
.B *
|
|
or
|
|
.B @
|
|
either by themselves or preceeding a
|
|
.B /
|
|
or
|
|
.B :
|
|
character;
|
|
.sp
|
|
It starts with a digit; or
|
|
.sp
|
|
It starts with
|
|
.B .
|
|
and is followed by at least one other character, where the next character
|
|
is neither
|
|
.B /
|
|
nor
|
|
.BR : .
|
|
.RE
|
|
.SH RETURN VALUES
|
|
1 - \fIname\fR is a full path name.
|
|
.br
|
|
0 - \fIname\fR is not a full path name.
|
|
.SH CAVEATS
|
|
Note that no test for existence of the file is made; only the validity
|
|
of the file name is checked.
|
|
.LP
|
|
With GS/OS, unlike the Unix filesystem,
|
|
.B /
|
|
is not recognised as a complete file (or directory) name. Therefore,
|
|
.BR isRootPath
|
|
will return 0 if
|
|
.BR name
|
|
is one character long and isn't
|
|
.B *
|
|
or
|
|
.B @
|
|
or a digit.
|
|
.LP
|
|
Under GS/OS, the test is carried out independant of any mounted file
|
|
systems, therefore only GS/OS rules are followed. In particular, there
|
|
is no
|
|
.BR JudgeName "(3)"
|
|
call made, therefore no gaurantee is made that the filename will be valid
|
|
for any given file system.
|
|
.SH HISTORY
|
|
This routine was originally called
|
|
.BR if_root_path
|
|
and was part of the
|
|
.BR lenviron
|
|
library. It was adapted from code in
|
|
.BR dmake (1)
|
|
for GNO v2.0.3 by Devin Reade in April 1994.
|
|
It was incorporated into the GNO
|
|
.BR libc
|
|
as of v2.0.6.
|
|
.BR dmake (1)
|
|
was written by Dennis Vadura,
|