LaTeXM...athname(3pm)
π NAME π
okay so bestie, this is the LaTeXM...athname(3pm) page (from the User Contributed Perl Documentation), and it's for the LaTeXML::Util::Pathname module β portable pathname and file-system utilities. Periodt. β¨
πΈ DESCRIPTION πΈ
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 β no cap. Lowkey obsessed with how clean that is. Iconic. π
π Pathname Manipulations π
$path = pathname_make(%peices);β builds a pathname out of the keyword pieces you pass in:dir: directoryname: the filename (possibly with extension)type: the filename extension
($dir,$name,$type) = pathname_split($path);β splits the pathname$pathinto its components: directory, name and type. Clean.$path = pathname_canonical($path);β canonicalizes the pathname$pathby simplifying repeated slashes, dots representing the current or parent directory, etc. It's giving cleanup era.$dir = pathname_directory($path);β returns the directory component of the pathname$path.$name = pathname_name($path);β returns the name component of the pathname$path.$type = pathname_type($path);β returns the type component of the pathname$path.$path = pathname_concat($dir,$file);β returns the pathname resulting from concatenating the directory$dirand filename$file.$boole = pathname_is_absolute($path);β returns whether the pathname$pathappears to be an absolute pathname. Vibe check: absolute or not?$boole = pathname_is_url($path);β returns whether the pathname$pathappears to be a url, rather than local file.$boole = pathname_is_literaldata($path);β returns whether the pathname$pathis actually a blob of literal data, with a leadingliteral:protocol. iykyk.$boole = pathname_is_raw($path);β checks if pathname indicates a raw TeX source or definition file, fr fr.$rel = pathname_is_contained($path,$base);β checks whether$pathis underneath the directory$base; if so it returns the pathname$pathrelative to$base; otherwise returnsundef. No cap.$path = pathname_relative($path,$base);β if$pathis an absolute, non-URL pathname, returns the pathname relative to the directory$base, otherwise simply returns the canonical form of$path.$path = pathname_absolute($path,$base);β returns the absolute pathname resulting from interpreting$pathrelative to the directory$base. If$pathis already absolute, it is returned unchanged. Highkey useful.$relative_url = pathname_to_url($path);β creates a local, relative URL for a given pathname, also ensuring proper path separators on non-Unix systems.
π¦ File System Operations π¦
$modtime = pathname_timestamp($path);β returns the modification time of the file named by$path, orundefif the file does not exist.$path = pathname_cwd();β returns the current working directory. Where you at, bestie?$dir = pathname_mkdir($dir);β creates the directory$dirand all missing ancestors. It returns$dirif successful, elseundef. Make the whole tree, not just the leaf.$dest = pathname_copy($source,$dest);β copies the file$sourceto$destif needed; ie. if$destis missing or older than$source. It preserves the timestamp of$source. Only copies when it has to.$path = pathname_find($name,%options);β finds the first file named$namethat exists and that matches the specification in the keywords%options. An absolute pathname is returned β you literally get an absolute pathname back.
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. Wildcard moment.
@paths = pathname_findall($name,%options);β likepathname_find, but returns all matching (absolute) paths that exist.$path = pathname_kpsewhich(@names);β attempt to find a candidate name via the externalkpsewhichcapability of the system's TeX toolchain. Ifkpsewhichis not available, or the file is not found, returns a Perl undefined value. Sometimes the answer is just undef, bestie. π
π AUTHOR π
Bruce Miller <bruce.miller@nist.gov>
π COPYRIGHT π
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
π That's a wrap, bestie! This page is fromperl v5.40.1, dated2025-11-16, and it's theLaTeXM...athname(3pm)manual. Now go slay those pathnames with main character energy. Periodt. β¨
π¦ where this page comes from
- ubuntu resolute: latexml 0.8.8-4 Β· PD
- ubuntu stonking: latexml 0.8.8-4 Β· PD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms