20

For me, a path was always something that "walks the way to something", but without the "something".

Like a chicken following bread crumbs until it hits the target. But the target is not part of the path. That's what I believe.

So, example: C:/foo/bar = the path. C:/foo/bar/something.html = Path and the "Target".

Can someone tell me what are the correct terms here? How do I call such a path with file?

"Full path"? "Full qualified path"? "Path with File Name"? (not precise! "Path with File Name and Extension" ... way too long)

Sure there's a special name for this. Want to know! :)

Aiden Bell
  • 28,212
  • 4
  • 75
  • 119
openfrog
  • 40,201
  • 65
  • 225
  • 373
  • 2
    A path can point to any object on the file system, including files. A path that contains a filename is a just a path. Paths can be relative or absolute, but that has nothing to do with the presence of a filename in the path. – user229044 Jan 22 '10 at 17:48
  • The path as you are using it is not the file itself. The file is actually the contents. So, in your analogy, the target is what is in the file, presumably starting with and ending with . So, the path of C:\foo\bar\something.html does guide you to the target. FYI, the term "file specification", or "filespec", can also be used. A "full filespec" would give you an absolute location (e.g. c:\foo\bar\something.html). I learned the term filespec in my VMS days. This was before I learned Unix, where path seems to be preferred. In some ways, I think filespec is better. – GreenMatt Jan 22 '10 at 17:54
  • 1
    you can see this link: http://stackoverflow.com/questions/2235173/file-name-path-name-base-name-naming-standard-for-pieces-of-a-path – nawfal Mar 11 '12 at 10:37
  • Re-reading this years later, there is something profound about the question. "There is no destination, only the end of the path" – Aiden Bell Jul 07 '16 at 14:59

4 Answers4

17

Nice chicken example... I think you mean absolute path

but, It doesn't matter what the path points to, be it a directory, file, device or otherwise

Wikipedia says:

A path, the general form of a filename or of a directory name, specifies a unique location in a file system.

It doesn't even require an extension, as other mechanisms work out the filetype.

  1. /foo/bar/file.txt = Absolute path
  2. /foo/bar = An absolute path to a directory
  3. ../foo = A relative path to a directory, from current directory
  4. ./file.txt = A relative path to a file, from current directory (Unix)
  5. file.txt = A relative path too

Also

Systems can use either absolute or relative paths. A full path or absolute path is a path that points to the same location on one file system regardless of the working directory or combined paths. It is usually written in reference to a root directory.

The distinction between files and directories isn't catered for with a path. A path is always a path to something, be it a file or a directory:

/a/b/c is the path to c regardless of what type (file, directory, device) the end point is.

Also checkout basenames

basename is a standard UNIX computer program, when basename is given a pathname, it will delete any prefix up to the last slash ('/') character and return the result. basename is described in the Single UNIX Specification and is primarily used in shell scripts.

Aiden Bell
  • 28,212
  • 4
  • 75
  • 119
0

From LINFO

A path is the address of an object (i.e., file, directory or link) on a filesystem.

So, unfortunately, you are looking for a specificity of terms that isn't part of the accepted usage. You'll have to define your own terms.

jball
  • 24,791
  • 9
  • 70
  • 92
0

I beleive it is called "full name" regardless of the "target" type, just because everything in UNIX is a file, including a directory. So if a foo is the target (as you called it), then foo is the name, while C:\Direcotry\foo or /usr/bin/foo is the foo's full name.

Igor Korkhov
  • 8,283
  • 1
  • 26
  • 31
0

i have been thinking about it too lately, because in Everything, the path do not include the "target" itself. but when i search in Wikipedia, it say that the target is included.

in your example, you have implicitly assume that there is "only one" target at the end of the bread crumbs. and someone tell the chicken to follow the bread crumbs and then it can get to the target.

what if there are 2 objects in the end? if someone did not tell which one is the target, e.g. include the target itself in the path, the chicken will never know its target.

you can also think like this: for a path which include the file, the target is not the file, but its content or some other imformation of the file.

back to the file system, assume there is several file in a folder. if file name is not included in its path, then they all have same path and you can not find a specific file through its path alone.