Portable pathname and file-system utilities
This module combines the functionality File::Spec and File::Basename to give a consistent set of filename utilities for LaTeXML. A pathname is represented by a simple string.
Constructs a pathname from the keywords in pieces dir : directory name : the filename (possibly with extension) type : the filename extension
Splits the pathname $path into the components: directory, name and type.
Canonicallizes the pathname $path by simplifying repeated slashes, dots representing the current or parent directory, etc.
Returns the directory component of the pathname $path.
Returns the name component of the pathname $path.
Returns the type component of the pathname $path.
Returns the pathname resulting from concatenating the directory $dir and filename $file.
Returns whether the pathname $path appears to be an absolute pathname.
Returns whether the pathname $path appears to be a url, rather than local file.
Returns whether the pathname $path is actually a blob of literal data, with a leading ”literal:” protocol.
Check if pathname indicates a raw TeX source or definition file.
Check for pathname exceptions where the same TeX definition file can be meaningfully reloaded. For example, babel.sty ”.ldf” files
Checks whether $path is underneath the directory $base; if so it returns the pathname $path relative to $base; otherwise returns undef.
If $path is an absolute, non-URL pathname, returns the pathname relative to the directory $base, otherwise simply returns the canonical form of $path.
Returns the absolute pathname resulting from interpretting $path relative to the directory $base. If $path is already absolute, it is returned unchanged.
Creates a local, relative URL for a given pathname, also ensuring proper path separators on non-Unix systems.
Returns the modification time of the file named by $path, or undef if the file does not exist.
Returns the current working directory.
Creates the directory $dir and all missing ancestors. It returns $dir if successful, else undef.
Copies the file $source to $dest if needed; ie. if $dest is missing or older than $source. It preserves the timestamp of $source.
Finds the first file named $name that exists and that matches the specification in the keywords %options. An absolute pathname is returned.
If $name is not already an absolute pathname, then the option paths determines directories to recursively search. It should be a list of pathnames, any relative paths are interpreted relative to the current directory. If paths is omitted, then the current directory is searched.
If the option installation_subdir is given, it indicates, in addition to the above, a directory relative to the LaTeXML installation directory to search. This allows files included with the distribution to be found.
The types option specifies a list of filetypes to search for. If not supplied, then the filename must match exactly. The type * matches any extension.
Like pathname_find, but returns all matching (absolute) paths that exist.
Attempt to find a candidate name via the external kpsewhich capability of the system’s TeX toolchain. If kpsewhich is not available, or the file is not found, returns a Perl undefined value.