Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Absolute ("/foo") and relative ("../foo") file names. What is the "foo" category called?

There are three types of file names

First (rooted below some kind of "current working directory")

../foo 
./foo
bar/foo # really in this group?

And (rooted in an absolute path, independent of the CWD)

/foo
/bar/foo

And (independent of the CWD and independent of any absolute path)

foo
bar/foo # really in this group?

I'm unsure where to put the bar/foo thing in. Is there a general naming convention for these three categories? Or are there more of them?

like image 982
Johannes Schaub - litb Avatar asked Nov 14 '22 20:11

Johannes Schaub - litb


1 Answers

foo is also a relative pathname. Any path not containing a directory separator is relative to the current directory .

In another taxonomy, you could call foo a basename; then bar/foo moves to the first category.

like image 200
Fred Foo Avatar answered Dec 10 '22 01:12

Fred Foo