What Is A Relative Path?

Table of Contents

A relative path, also known as a non-absolute or partial path, is a URL that comprises only a section of the entire path.

For example, the hierarchical path detects a folder or file on a file system starting from the current directory. The whole location depends on its relation to the directory to link it.  

The relative path is different from the absolute path, which discovers the file or folder starting from the file system’s root. These shorter addresses are convenient for creating web pages because they require less typing and take up fewer characters.

How Does a Relative Path Work?

A relative path is a way to give the location of a directory relative to another directory. 

For instance, if your documents are in “C:\Sample\Documents” and your index is in “C:\Sample\Index,” the relative path to “C:\Sample\Documents” would be ..\Documents. However, the document’s absolute path is “C:\Sample\Documents.” 

Furthermore, when documents are on the same drive as the index, “dtSearch” automatically uses relative paths to store document locations. 

Adding “c:\Sample\Documents\smith.doc” to an index in “c:\Sample\Index,” causes the index to store the document path as “..\Documents\smith.doc.” The relative path is more flexible because, by moving the entire “C:\Sample directory” to another location, such as “J:\Sample or C:\Smith\Sample” or “H:\Sample,” the relative path to the documents remains valid. 

Why Use Relative Path?

Relative paths are helpful for shared indexes on networks when a physical drive uses a different drive letter for different users. For instance, some users might see a drive as “S:” while others see it as “T:” If documents reside on the same drive as their index, “dtSearch” can use relative paths to prevent these drive mapping problems.

Relative paths are also helpful for text database publishers who wish to distribute an index and text package. If the relative paths option creates the index, users can install the package on any drive and in any directory without influencing the index’s validity. 

The table of indexes stores index directories relative to the index library’s location in an index library. 

Relative Path Attributes:

  • Relative paths cannot span disk drives.
  • Absolute paths work best when data is not moved, which is typical for disks on a personal computer. Relative paths work best when delivering documents and data to another user.
  • Relative paths use dot/double-dot (. and ..) notation. One can enter relative paths with this notation at the Windows command prompt or Windows Explorer.
  • ArcGIS does not permit entering relative paths using dot/double-dot notation. Instead, the document or toolbox (after checking the option Store relative path names) store relative paths.
  • Relative paths are relative to a current directory that is the saved toolbox or document’s location.

Share

Recommended From Elementor

The Future
of Web Creation. Straight to
Your Inbox.

What Intrests You?


Great!

Awsome content is on the way.