What is the technical term for current (.) and parent (..) directory?

From the POSIX standard:

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.

So, really, if you want to check whether the filename is . or .. you would have to call it IsDotOrDotDot(), or, using the POSIX terminology of pathname resolution, IsPredecessorOrParentOfPredecessor(), or maybe even PointsToPredecessorOrParentOfPrecedessor() … you get the idea. The problem is that the latter terminology only makes sense when looking at full pathnames. But nobody would understand that anyway.

Considering that . and .. are valid filenames (just interpreted differently), you should just stick to what you have, relying on the meaning rather than how they are called internally.


. and .. are usually used to describe relative paths vs. absolute ones like /usr. I'd use this difference and declare the function as IsRelativeCurrentOrParentDirectory().

Be aware the dot-references may occur anywhere in the path. What about /usr/local/..?


The POSIX Standard, which slhck♦ usefully quoted, says,

The special filename dot shall refer to ….  The special filename dot-dot shall refer to ….

(emphasis added).  So, while it’s not exactly technical, it looks like “special filename” just might be the official name.  Your users would probably understand it if you called your function any of the following: IsSpecialDirectory(), IsSpecialFilename(), or simply IsSpecialName().

Or you could go with IsStandardDirectory(), IsStandardFilename(), or IsStandardName().  This follows the Unix naming convention (standard input, standard output) for things that are established for you automatically (in this case, by mkfs and mkdir).  IsAutomatic…() or IsDefault…(), on the other hand, probably are not intuitive enough.

Tags:

Path