Search logic with "stat"

You must take the type of directory (explicit vs implicit) into consideration when working with the "stat" action and an ObjectStore (NS4) storage group.

Implicit directories

By default, only explicit directories are checked by stat. If desired, you can append implicit=yes to the action header to target implicit directories.

Explicit directories

The stat action’s search logic for an explicit directory is dependent on how the [path] variable is defined (whether or not it ends in a trailing slash - “/”):

  • The Specified [path] ENDS in a “/”:
    1. The system searches the exact [path] given.
    2. The system returns response output with the trailing slash in the entry’s name attribute.
    3. If nothing is found, a “404 Error” is returned.
  • The Specified [path] DOES NOT END in a “/”:
    1. The system will search the exact [path] given. If a “file” or “symlink” is located, a stat record for it is returned. If not, go to “b)”.
    2. The system re-performs the search, with a trailing slash appended to the specified [path], in which the following could result:
    • If a Directory is Found: Return that stat record in the response output, without the trailing slash in the entry’s name attribute.
    • If a File or Symlink is Found: Return that stat record in the response output, without the trailing slash in the name attribute, with type=“dir” and implicit=“yes”.
    1. If nothing is found, return a “404 Error.”