Next: , Up: parser-tools unix-pathnames   [Index]


54.1.1 Grammar of Unix pathnames

A Unix pathname has the following grammar:

pathname           = absolute-pathname
                   | relative-pathname

absolute-pathname  = "/" segment *( "/" segment )
relative-pathname  = segment-nz *( "/" segment )

segment            = *char
segment-nz         = 1*char

char               = [1, 255]

where [1, 255] represents the octet interval between 1 included and 255 included. Notice that: an empty pathname is invalid; an empty segment is valid and interpreted as equivalent to a pathname segment representing the current directory ‘.’.