| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "File::Spec::Win32 3perl" |
| 58 |
.TH File::Spec::Win32 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide" |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
File::Spec::Win32 \- methods for Win32 file specs |
| 65 |
.SH SYNOPSIS |
| 66 |
.IX Header "SYNOPSIS" |
| 67 |
.Vb 1 |
| 68 |
\& require File::Spec::Win32; # Done internally by File::Spec if needed |
| 69 |
.Ve |
| 70 |
.SH DESCRIPTION |
| 71 |
.IX Header "DESCRIPTION" |
| 72 |
See File::Spec::Unix for a documentation of the methods provided |
| 73 |
there. This package overrides the implementation of these methods, not |
| 74 |
the semantics. |
| 75 |
.IP devnull 4 |
| 76 |
.IX Item "devnull" |
| 77 |
Returns a string representation of the null device. |
| 78 |
.IP tmpdir 4 |
| 79 |
.IX Item "tmpdir" |
| 80 |
Returns a string representation of the first existing directory |
| 81 |
from the following list: |
| 82 |
.Sp |
| 83 |
.Vb 8 |
| 84 |
\& $ENV{TMPDIR} |
| 85 |
\& $ENV{TEMP} |
| 86 |
\& $ENV{TMP} |
| 87 |
\& SYS:/temp |
| 88 |
\& C:\esystem\etemp |
| 89 |
\& C:/temp |
| 90 |
\& /tmp |
| 91 |
\& / |
| 92 |
.Ve |
| 93 |
.Sp |
| 94 |
The SYS:/temp is preferred in Novell NetWare and the C:\esystem\etemp |
| 95 |
for Symbian (the File::Spec::Win32 is used also for those platforms). |
| 96 |
.Sp |
| 97 |
If running under taint mode, and if the environment |
| 98 |
variables are tainted, they are not used. |
| 99 |
.IP case_tolerant 4 |
| 100 |
.IX Item "case_tolerant" |
| 101 |
MSWin32 case-tolerance depends on \fBGetVolumeInformation()\fR \f(CW$ouFsFlags\fR == FS_CASE_SENSITIVE, |
| 102 |
indicating the case significance when comparing file specifications. |
| 103 |
Since XP FS_CASE_SENSITIVE is effectively disabled for the NT subsubsystem. |
| 104 |
See <http://cygwin.com/ml/cygwin/2007\-07/msg00891.html> |
| 105 |
Default: 1 |
| 106 |
.IP file_name_is_absolute 4 |
| 107 |
.IX Item "file_name_is_absolute" |
| 108 |
As of right now, this returns 2 if the path is absolute with a |
| 109 |
volume, 1 if it's absolute with no volume, 0 otherwise. |
| 110 |
.IP catfile 4 |
| 111 |
.IX Item "catfile" |
| 112 |
Concatenate one or more directory names and a filename to form a |
| 113 |
complete path ending with a filename |
| 114 |
.IP canonpath 4 |
| 115 |
.IX Item "canonpath" |
| 116 |
No physical check on the filesystem, but a logical cleanup of a |
| 117 |
path. On UNIX eliminated successive slashes and successive "/.". |
| 118 |
On Win32 makes |
| 119 |
.Sp |
| 120 |
.Vb 2 |
| 121 |
\& dir1\edir2\edir3\e..\e..\edir4 \-> \edir\edir4 and even |
| 122 |
\& dir1\edir2\edir3\e...\edir4 \-> \edir\edir4 |
| 123 |
.Ve |
| 124 |
.IP splitpath 4 |
| 125 |
.IX Item "splitpath" |
| 126 |
.Vb 3 |
| 127 |
\& ($volume,$directories,$file) = File::Spec\->splitpath( $path ); |
| 128 |
\& ($volume,$directories,$file) = File::Spec\->splitpath( $path, |
| 129 |
\& $no_file ); |
| 130 |
.Ve |
| 131 |
.Sp |
| 132 |
Splits a path into volume, directory, and filename portions. Assumes that |
| 133 |
the last file is a path unless the path ends in '\e\e', '\e\e.', '\e\e..' |
| 134 |
or \f(CW$no_file\fR is true. On Win32 this means that \f(CW$no_file\fR true makes this return |
| 135 |
( \f(CW$volume\fR, \f(CW$path\fR, '' ). |
| 136 |
.Sp |
| 137 |
Separators accepted are \e and /. |
| 138 |
.Sp |
| 139 |
Volumes can be drive letters or UNC sharenames (\e\eserver\eshare). |
| 140 |
.Sp |
| 141 |
The results can be passed to "catpath" to get back a path equivalent to |
| 142 |
(usually identical to) the original path. |
| 143 |
.IP splitdir 4 |
| 144 |
.IX Item "splitdir" |
| 145 |
The opposite of \fBcatdir()\fR. |
| 146 |
.Sp |
| 147 |
.Vb 1 |
| 148 |
\& @dirs = File::Spec\->splitdir( $directories ); |
| 149 |
.Ve |
| 150 |
.Sp |
| 151 |
\&\f(CW$directories\fR must be only the directory portion of the path on systems |
| 152 |
that have the concept of a volume or that have path syntax that differentiates |
| 153 |
files from directories. |
| 154 |
.Sp |
| 155 |
Unlike just splitting the directories on the separator, leading empty and |
| 156 |
trailing directory entries can be returned, because these are significant |
| 157 |
on some OSs. So, |
| 158 |
.Sp |
| 159 |
.Vb 1 |
| 160 |
\& File::Spec\->splitdir( "/a/b//c/" ); |
| 161 |
.Ve |
| 162 |
.Sp |
| 163 |
Yields: |
| 164 |
.Sp |
| 165 |
.Vb 1 |
| 166 |
\& ( \*(Aq\*(Aq, \*(Aqa\*(Aq, \*(Aqb\*(Aq, \*(Aq\*(Aq, \*(Aqc\*(Aq, \*(Aq\*(Aq ) |
| 167 |
.Ve |
| 168 |
.IP catpath 4 |
| 169 |
.IX Item "catpath" |
| 170 |
Takes volume, directory and file portions and returns an entire path. Under |
| 171 |
Unix, \f(CW$volume\fR is ignored, and this is just like \fBcatfile()\fR. On other OSs, |
| 172 |
the \f(CW$volume\fR become significant. |
| 173 |
.SS "Note For File::Spec::Win32 Maintainers" |
| 174 |
.IX Subsection "Note For File::Spec::Win32 Maintainers" |
| 175 |
Novell NetWare inherits its File::Spec behaviour from File::Spec::Win32. |
| 176 |
.SH COPYRIGHT |
| 177 |
.IX Header "COPYRIGHT" |
| 178 |
Copyright (c) 2004,2007 by the Perl 5 Porters. All rights reserved. |
| 179 |
.PP |
| 180 |
This program is free software; you can redistribute it and/or modify |
| 181 |
it under the same terms as Perl itself. |
| 182 |
.SH "SEE ALSO" |
| 183 |
.IX Header "SEE ALSO" |
| 184 |
See File::Spec and File::Spec::Unix. This package overrides the |
| 185 |
implementation of these methods, not the semantics. |