包含完整文件名的路径名称?

发布于 2024-08-19 13:02:33 字数 292 浏览 1 评论 0原文

对我来说,路径总是“走在通往某物的路上”的东西,但没有“某物”。

就像一只鸡跟随面包屑,直到它击中目标。但目标不是路径的一部分。这就是我所相信的。

因此,例如:C:/foo/bar = 路径。 C:/foo/bar/something.html = 路径和“目标”。

有人能告诉我这里正确的术语是什么吗?如何用文件调用这样的路径?

“完整路径”? “完全合格的路径”? “带文件名的路径”? (不精确!“带有文件名和扩展名的路径”......太长)

当然有一个特殊的名称。想知道吗! :)

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! :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梅窗月明清似水 2024-08-26 13:02:33

很好的鸡例子...我认为你的意思是绝对路径

但是,路径指向什么并不重要,无论是目录、文件、设备还是其他

< a href="http://en.wikipedia.org/wiki/Path_%28computing%29" rel="noreferrer">维基百科 说:

路径是文件名或目录名的一般形式,指定文件系统中的唯一位置。

甚至不需要扩展名,因为其他机制可以确定文件类型。

  1. /foo/bar/file.txt = 绝对路径
  2. /foo/bar = 目录的绝对路径
  3. ../foo = 相对路径从当前目录到目录的路径
  4. ./file.txt = 从当前目录到文件的相对路径 (Unix)
  5. 相对路径

file.txt =也是

系统可以使用绝对路径或相对路径。完整路径或绝对路径是指向一个文件系统上同一位置的路径,无论工作目录或组合路径如何。它通常是参考根目录编写的。

路径无法满足文件和目录之间的区别。路径始终是某物的路径,无论是文件还是目录:

/a/b/cc 的路径无论是什么类型< /strong>(文件、目录、设备)终点是。

另请检查基本名称

basename是一个标准的UNIX计算机程序,当给basename一个路径名时,它将删除最后一个斜杠('/')字符之前的任何前缀并返回结果。 basename 在单一 UNIX 规范中进行了描述,主要用于 shell 脚本中。

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.

っ左 2024-08-26 13:02:33

来自 LINFO

路径是对象的地址
(即文件、目录或链接)
文件系统。

因此,不幸的是,您正在寻找不属于可接受用法的术语的特殊性。您必须定义自己的术语。

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.

晨与橙与城 2024-08-26 13:02:33

我相信无论“目标”类型如何,它都被称为“全名”,只是因为 UNIX 中的所有内容都是文件,包括目录。因此,如果 foo 是目标(如您所称),则 foo 是名称,而 C:\Direcotry\foo 或 < code>/usr/bin/foo 是 foo 的全名。

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.

复古式 2024-08-26 13:02:33

我最近一直在思考这个问题,因为在Everything中,路径不包括“目标”本身。但是当我在维基百科中搜索时,它说目标已包含在内。

在您的示例中,您隐含地假设面包屑的末尾有“只有一个”目标。有人告诉小鸡沿着面包屑走,它就能到达目标。

如果最后有2个对象怎么办?如果有人没有告诉哪个是目标,例如将目标本身包含在路径中,鸡将永远不会知道它的目标。

你也可以这样想:对于包含文件的路径,目标不是文件,而是文件的内容或文件的其他信息。

回到文件系统,假设一个文件夹中有多个文件。如果文件名不包含在其路径中,则它们都具有相同的路径,并且您无法仅通过其路径找到特定文件。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文