I need a name for them both together. Do they have one?
I want to build a strip"DOT_AND_DOTDOT"() function that gets rid of them ...
I need a name for them both together. Do they have one?
I want to build a strip"DOT_AND_DOTDOT"() function that gets rid of them ...
Historically, they are called "dot" and "dot dot". The name for them as an aggregate is "those dots".
As far as I know there isn't a name for them collectively.
As "." is the current directory and ".." is the parent directory, you could go for "this_and_parent" I suppose.
How about strip_meta_dirs()
or enum_real_dirs()
or a funny one ... notdot_filter_dirs()
I'd be interested to see if there's an official name for them, but I'd call them "location markers" or "directory location markers".
They're "current directory" and "parent directory", but I suppose they could be called "intrinsic entries" since they're created in every directory by default.
strip_dot_and_dotdot_from_filepath() is immediately understandable to me and I suspect the vast majority of programmers.
Using fancy words sometimes only confuses things.
It's not their names but . represents the current directory and .. the parent directory.
How about stripParentAndCurrentDirs()?
(I was going to suggest stripDotDirs(), but I'd call a directory like .git a dot directory.)
Since every *NIX system hides every entry starting with . i would call the method "strip_hidden_entries()" and just remove everything starting with a . (now how do you end a sentence if the last character is a dot which is not meant to be the period?)
stripDotMetaDirs() or stripThoseDots() according to John Saunders's answer
Flip the problem:
Name the function getDirectories and just return everything except those. Then you don't need to mention them at all since it is fairly intuitive for them to not be included in a directory list.