Difference between revisions of "API:FS.fullPath"

From Spherical
Jump to: navigation, search
(FS.fullPath() API page)
(No difference)

Revision as of 17:34, 17 August 2017

The FS.fullPath() function computes the canonical SphereFS pathname for a specified relative path and base directory.

canon_path = FS.fullPath(file_or_dir_name[, base_path]);

API Information


FS.fullPath() returns the complete, canonical SphereFS pathname for a given file or directory. If the path to be resolved already includes a SphereFS prefix such as @/ or ~/, then Sphere simply canonicalizes it (by removing any relative components); otherwise the path itself is considered relative and will be rebased before canonicalization. This allows you to get the full pathname of a file or directory given only its name and a known base directory, which can be useful in libraries.


Name Type Default Value Description
file_or_dir_name string n/a (Required) The name of a file or directory. May include path components. It doesn't need to actually exist.
base_path string "@/" Specifies the base directory onto which relative paths will be rebased.

Return Value

The full SphereFS pathname of the specified file or directory.

See Also