So one should be careful with relative paths. The simplest example of relative path is just a file name, like index.html. If you don't supply the root, it means that your path is relative. on Windows it's either \ (for the current disk) or D:\ (system-wide).So now you can tell an absolute path from a relative one - it is starting from the root, which is: So you can tell that windows is rather confusing, but for the simplicity we would pretend that we have only one disk, and within its boundaries the rules are pretty much the same as in Unix. So you can type cd \ and get to the root of the current disk. Whereas each disk has its own root, which is a backslash - \. On Windows, the filesystem doesn't have the common root for the whole system but split between disks, so an absolute paths starts from the drive letter. So you can tell that in the address the trailing slash is not for the decoration but a regular address itself - the address of the home page. Exactly the same is true for all web servers. Type cd / in your unix console and you will get to the root directory. It is not just a marker, but already a full qualified address, a path. Note that in Unix-like systems (and web-servers) the root is defined as a slash - /. Some absolute path examples: /var/ www / html / forum / index. So again: an absolute path is one starting from the system root Whereas relative path is tricky, and should be used with caution, only when you positively know where you are at the moment. So it goes for the paths in the computer world: given the absolute address, you can always get to the place, no matter from where you started. However, given the relative directions, like "keep three blocks this way and then and turn to the right" would work from the current location only, otherwise sending you astray. Given the absolute address, a postal one, like "7119 W Sunset Blvd West Hollywood, CA 90046" you can find the location from anywhere. It's exactly the same as with the real life directions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |