[pg-cvs] osicat dotted-namestrings and absolute-pathname interaction around directory iterators

MON KEY monkey at sandpframing.com
Wed Aug 17 18:39:29 UTC 2011


On Sat, Aug 13, 2011 at 12:38 PM, Stelian Ionescu <sionescu at cddr.org> wrote:
>
> The README will probably need to be corrected, then
>

So, are you suggestiong that osicat is intended as POSIX-style API?

>
> POSIX file-systems have no notion of name and type, and syntax-wise a
> file and a directory are the same, so ".." is the same thing as "../"

Permit me to disagree.

By all means feel free to ignore my objections to Osicat's behaviour
around a corner case in differences between CL pathnames and POSIX.
However, please have the courtesy to at least consider that my
citation of section 4.12 IEEE Std 1003.1-2008 was not without reason
and was in fact an attempt to illustrate reasonably that POSIX 2008
_does_ have some fairly clear stipulations about the syntax for
pathnames around a file and a directory not always being the same.

POSIX prescribes certain syntax as denoting a "special filename":

 "."    (dot)
 ".."   (dot-dot)
 "/"    (<slash>)
 "//"   (<slash> <slash>)
 "///*" (<slash> <slash> <slash>*)


FFR following are what i believe to be relevant sections of POSIX-2008:

,----
| 3.266 Pathname
|
| A character string that is used to identify a file. In the context of
| POSIX.1-2008, a pathname may be limited to {PATH_MAX} bytes, including
| the terminating null byte. It has an optional beginning <slash>,
| followed by zero or more filenames separated by <slash> characters. A
| pathname may optionally contain one or more trailing <slash>
| characters. Multiple successive <slash> characters are considered to
| be the same as one <slash>, except for the case of exactly two leading
| <slash> characters.
|
| Note:
|     Pathname Resolution is defined in detail in Pathname Resolution .
|
| { ... elided ... }
|
| 3.268 Path Prefix
|
| The part of a pathname up to, but not including, the last component
| and any trailing <slash> characters, unless the pathname consists
| entirely of <slash> characters, in which case the path prefix is '/'
| for a pathname containing either a single <slash> or three or more
| <slash> characters, and '//' for the pathname //. The path prefix of a
| pathname containing no <slash> characters is empty, but is treated as
| referring to the current working directory.
|
| Note: The term is used both in the sense of identifying part of a
|     pathname that forms the prefix and of joining a non-empty path
|     prefix to a filename to form a pathname. In the latter case, the
|     path prefix need not have a trailing <slash> (in which case the
|     joining is done with a <slash> character).
`----

,----
|
| 4.12 Pathname Resolution
|  {...}
|
| The special filename dot shall refer to the directory specified by
| its predecessor. The special filename dot-dot shall refer to the
| parent directory of its predecessor directory. As a special case, in
| the root directory, dot-dot may refer to the root directory itself.
|
| The Open Group Base Specifications Issue 7 IEEE Std 1003.1-2008
|
`---- :SOURCE (URL `http://pubs.opengroup.org/onlinepubs/9699919799/')

--
/s_P\




More information about the osicat-devel mailing list