.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "LaTeXML::Util::Pathname 3pm" .TH LaTeXML::Util::Pathname 3pm "2013-11-19" "perl v5.18.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" "LaTeXML::Util::Pathname" \- portable pathname and file\-system utilities .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module combines the functionality File::Spec and File::Basename to give a consistent set of filename utilties for LaTeXML. A pathname is represented by a simple string. .SS "Pathname Manipulations" .IX Subsection "Pathname Manipulations" .ie n .IP """$path = pathname_make(%peices);""" 4 .el .IP "\f(CW$path = pathname_make(%peices);\fR" 4 .IX Item "$path = pathname_make(%peices);" Constructs a pathname from the keywords in pieces dir : directory name : the filename (possibly with extension) type : the filename extension .ie n .IP """($dir,$name,$type) = pathname_split($path);""" 4 .el .IP "\f(CW($dir,$name,$type) = pathname_split($path);\fR" 4 .IX Item "($dir,$name,$type) = pathname_split($path);" Splits the pathname \f(CW$path\fR into the components: directory, name and type. .ie n .IP """$path = pathname_canonical($path);""" 4 .el .IP "\f(CW$path = pathname_canonical($path);\fR" 4 .IX Item "$path = pathname_canonical($path);" Canonicallizes the pathname \f(CW$path\fR by simplifying repeated slashes, dots representing the current or parent directory, etc. .ie n .IP """$dir = pathname_directory($path);""" 4 .el .IP "\f(CW$dir = pathname_directory($path);\fR" 4 .IX Item "$dir = pathname_directory($path);" Returns the directory component of the pathname \f(CW$path\fR. .ie n .IP """$name = pathname_name($path);""" 4 .el .IP "\f(CW$name = pathname_name($path);\fR" 4 .IX Item "$name = pathname_name($path);" Returns the name component of the pathname \f(CW$path\fR. .ie n .IP """$type = pathname_type($path);""" 4 .el .IP "\f(CW$type = pathname_type($path);\fR" 4 .IX Item "$type = pathname_type($path);" Returns the type component of the pathname \f(CW$path\fR. .ie n .IP """$path = pathname_concat($dir,$file);""" 4 .el .IP "\f(CW$path = pathname_concat($dir,$file);\fR" 4 .IX Item "$path = pathname_concat($dir,$file);" Returns the pathname resulting from concatenating the directory \f(CW$dir\fR and filename \f(CW$file\fR. .ie n .IP """$boole = pathname_is_absolute($path);""" 4 .el .IP "\f(CW$boole = pathname_is_absolute($path);\fR" 4 .IX Item "$boole = pathname_is_absolute($path);" Returns whether the pathname \f(CW$path\fR appears to be an absolute pathname. .ie n .IP """$boole = pathname_is_url($path);""" 4 .el .IP "\f(CW$boole = pathname_is_url($path);\fR" 4 .IX Item "$boole = pathname_is_url($path);" Returns whether the pathname \f(CW$path\fR appears to be a url, rather than local file. .ie n .IP """$rel = pathname_is_contained($path,$base);""" 4 .el .IP "\f(CW$rel = pathname_is_contained($path,$base);\fR" 4 .IX Item "$rel = pathname_is_contained($path,$base);" Checks whether \f(CW$path\fR is underneath the directory \f(CW$base\fR; if so it returns the pathname \f(CW$path\fR relative to \f(CW$base\fR; otherwise returns undef. .ie n .IP """$path = pathname_relative($path,$base);""" 4 .el .IP "\f(CW$path = pathname_relative($path,$base);\fR" 4 .IX Item "$path = pathname_relative($path,$base);" If \f(CW$path\fR is an absolute, non-URL pathname, returns the pathname relative to the directory \f(CW$base\fR, otherwise simply returns the canonical form of \f(CW$path\fR. .ie n .IP """$path = pathname_absolute($path,$base);""" 4 .el .IP "\f(CW$path = pathname_absolute($path,$base);\fR" 4 .IX Item "$path = pathname_absolute($path,$base);" Returns the absolute pathname resulting from interpretting \&\f(CW$path\fR relative to the directory \f(CW$base\fR. If \f(CW$path\fR is already absolute, it is returned unchanged. .SS "File System Operations" .IX Subsection "File System Operations" .ie n .IP """$modtime = pathname_timestamp($path);""" 4 .el .IP "\f(CW$modtime = pathname_timestamp($path);\fR" 4 .IX Item "$modtime = pathname_timestamp($path);" Returns the modification time of the file named by \f(CW$path\fR, or undef if the file does not exist. .ie n .IP """$path = pathname_cwd();""" 4 .el .IP "\f(CW$path = pathname_cwd();\fR" 4 .IX Item "$path = pathname_cwd();" Returns the current working directory. .ie n .IP """$dir = pathname_mkdir($dir);""" 4 .el .IP "\f(CW$dir = pathname_mkdir($dir);\fR" 4 .IX Item "$dir = pathname_mkdir($dir);" Creates the directory \f(CW$dir\fR and all missing ancestors. It returns \f(CW$dir\fR if successful, else undef. .ie n .IP """$dest = pathname_copy($source,$dest);""" 4 .el .IP "\f(CW$dest = pathname_copy($source,$dest);\fR" 4 .IX Item "$dest = pathname_copy($source,$dest);" Copies the file \f(CW$source\fR to \f(CW$dest\fR if needed; ie. if \f(CW$dest\fR is missing or older than \f(CW$source\fR. It preserves the timestamp of \f(CW$source\fR. .ie n .IP """$path = pathname_find($name,%options);""" 4 .el .IP "\f(CW$path = pathname_find($name,%options);\fR" 4 .IX Item "$path = pathname_find($name,%options);" Finds the first file named \f(CW$name\fR that exists and that matches the specification in the keywords \f(CW%options\fR. An absolute pathname is returned. .Sp If \f(CW$name\fR is not already an absolute pathname, then the option \f(CW\*(C`paths\*(C'\fR determines directories to recursively search. It should be a list of pathnames, any relative paths are interpreted relative to the current directory. If \f(CW\*(C`paths\*(C'\fR is omitted, then the current directory is searched. .Sp If the option \f(CW\*(C`installation_subdir\*(C'\fR 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. .Sp The \f(CW\*(C`types\*(C'\fR option specifies a list of filetypes to search for. If not supplied, then the filename must match exactly. The type \f(CW\*(C`*\*(C'\fR matches any extension. .ie n .IP """@paths = pathname_findall($name,%options);""" 4 .el .IP "\f(CW@paths = pathname_findall($name,%options);\fR" 4 .IX Item "@paths = pathname_findall($name,%options);" Like \f(CW\*(C`pathname_find\*(C'\fR, but returns \fIall\fR matching (absolute) paths that exist. .SH "AUTHOR" .IX Header "AUTHOR" Bruce Miller .SH "COPYRIGHT" .IX Header "COPYRIGHT" Public domain software, produced as part of work done by the United States Government & not subject to copyright in the \s-1US.\s0