什么是“规范路径"? [英] What's a "canonical path"?

查看:570
本文介绍了什么是“规范路径"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个理论问题.我在网上搜索时运气不佳,我只想了解这是什么用语.我已经看过Java,JSON等示例,但在Google或StackOverflow中都找不到简单的解释,不需要代码= P

That's a theory question. I've searched over the internet with no satisfying luck, I just want to understand what's this jargon. I've seen examples of Java, JSON, etc but I couldn't find in Google nor here in StackOverflow a simple explanation, no code needed =P

因此,绝对路径是一种访问特定文件或位置的方法,该文件或位置描述了指向该文件或路径的完整路径,完整路径,并且它取决于操作系统(例如,Windows和Linux的绝对路径是不同的) path是从当前位置描述的文件或位置的路由..(两个点)指示目录树中的上级.几年来我一直很清楚.

So, an absolute path it's a way to get to a certain file or location describing the full route to it, the full path, and it's OS dependent (the absolute paths for Windows and Linux for example, are different) A relative path it's a route to a file or location which it's described from the current location .. (two dots) indicating a superior level in the directories tree. That has been clear to me for several years now.

搜索时,我什至也看到有规范化的文件! 据我所知,规范意味着诸如根据规则"之类的东西.

When searching I've even seen there are canonicalized files too! All I know it's CANONICAL means something like "according to the rules" or something.

有人可以请我对有关规范性东西的理论进行启发吗? =)谢谢!!

Can somebody please enlighten me in therms of theory about canonical stuff please? =) THANKS!!

PD(毕竟,它不仅仅是Ubuntu的随机名称)

PD (So Its wasn't just a Ubuntu random name after all) XD

PD2很遗憾,我无法将答案提供给所有人,我将答案提供给了最能帮助我理解这一概念的人,但是非常感谢大家=)

PD2 Sadly I can't give the answer to everyone, I gave it to the one that helped me most understand the concept, but thanks a lot to everyone =)

推荐答案

使任何事情成为规范"的全部目的是,您可以比较两件事.例如,../../here/bar/x./test/../../bar/x可能都指向同一位置,但是您不能在两个路径上进行文本比较.但是,如果将它们转换为它们的规范表示形式,它们都将变为../bar/x,并且我们看到它们实际上是指同一件事.

The whole point of making anything "canonical" is so that you can compare two things. For example, both ../../here/bar/x and ./test/../../bar/x may refer to the same location, but you can't do a textual comparison on the two paths. However, if you turn them into their canonical representation, they both become ../bar/x, and we see that they actually refer to the same thing.

简而言之,通常情况下,您有多种方式引用一件事,并且在这种情况下,您可以定义唯一的规范表示. em>,这样您就可以掌握这些事情.

In short, it is often the case that you have many ways of referring to one thing, and in that case you may be able to define a canonical representation which is unique and which allows you to get a handle on col­lections of such things.

(如果您要查找更多示例,则所有数学都充满了针对各种对象的规范"构造,并且出于相同的目的.也许这

(If you're looking for more examples, all of mathematics is full of "canonical" constructions for all sorts of objects, and very much with the same purpose in mind. Maybe this Wikipedia article can provide some ad­ditional directions.)

这篇关于什么是“规范路径"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆