Symisc Systems

Libcox Command Reference


Star Follow @symisc

Command Syntax

pathinfo path [options]


Alias

None


Description

Returns information about a file path. The following array entries are returned if the options parameter is not set:


Parameters

path

The path to be parsed.

options

Optional Parameter: If present, specifies a specific element to be returned; one of:
PATHINFO_DIRNAME 1
PATHINFO_BASENAME 2
PATHINFO_EXTENSION 3
PATHINFO_FILENAME 4.


Return Value

Array/String: If the options parameter is not passed, an associative array is returned. If options is present, returns a string containing the requested element. Use libcox_array_next_elem() or libcox_array_walk() to iterate over the array elements, libcox_array_fetch() or libcox_array_fetch_by_key() to extract array entries by indexes or keys.