home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_49f6e4ed9e4e3f3d35955147f75cc430
< prev
next >
Wrap
Text File
|
2000-03-23
|
6KB
|
164 lines
<HTML>
<HEAD>
<TITLE>File::Spec::Win32 - methods for Win32 file specs</TITLE>
<LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> File::Spec::Win32 - methods for Win32 file specs</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#see also">SEE ALSO</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>File::Spec::Win32 - methods for Win32 file specs</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
require File::Spec::Win32; # Done internally by File::Spec if needed</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>See File::Spec::Unix for a documentation of the methods provided
there. This package overrides the implementation of these methods, not
the semantics.</P>
<DL>
<DT><STRONG><A NAME="item_devnull">devnull</A></STRONG><BR>
<DD>
Returns a string representation of the null device.
<P></P>
<DT><STRONG><A NAME="item_tmpdir">tmpdir</A></STRONG><BR>
<DD>
Returns a string representation of the first existing directory
from the following list:
<PRE>
$ENV{TMPDIR}
$ENV{TEMP}
$ENV{TMP}
/tmp
/</PRE>
<P></P>
<DT><STRONG><A NAME="item_catfile">catfile</A></STRONG><BR>
<DD>
Concatenate one or more directory names and a filename to form a
complete path ending with a filename
<P></P>
<DT><STRONG><A NAME="item_canonpath">canonpath</A></STRONG><BR>
<DD>
No physical check on the filesystem, but a logical cleanup of a
path. On UNIX eliminated successive slashes and successive ``/.''.
<P></P>
<DT><STRONG><A NAME="item_splitpath">splitpath</A></STRONG><BR>
<DD>
<PRE>
($volume,$directories,$file) = File::Spec->splitpath( $path );
($volume,$directories,$file) = File::Spec->splitpath( $path, $no_file );</PRE>
<P>Splits a path in to volume, directory, and filename portions. Assumes that
the last file is a path unless the path ends in '\\', '\\.', '\\..'
or $no_file is true. On Win32 this means that $no_file true makes this return
( $volume, $path, undef ).</P>
<P>Separators accepted are \ and /.</P>
<P>Volumes can be drive letters or UNC sharenames (\\server\share).</P>
<P>The results can be passed to <A HREF="#catpath">catpath</A> to get back a path equivalent to
(usually identical to) the original path.</P>
<DT><STRONG><A NAME="item_splitdir">splitdir</A></STRONG><BR>
<DD>
The opposite of <A HREF="#catdir()">catdir()</A>.
<PRE>
@dirs = File::Spec->splitdir( $directories );</PRE>
<P>$directories must be only the directory portion of the path on systems
that have the concept of a volume or that have path syntax that differentiates
files from directories.</P>
<P>Unlike just splitting the directories on the separator, leading empty and
trailing directory entries can be returned, because these are significant
on some OSs. So,</P>
<PRE>
File::Spec->splitdir( "/a/b/c" );</PRE>
<P>Yields:</P>
<PRE>
( '', 'a', 'b', '', 'c', '' )</PRE>
<P></P>
<DT><STRONG><A NAME="item_catpath">catpath</A></STRONG><BR>
<DD>
Takes volume, directory and file portions and returns an entire path. Under
Unix, $volume is ignored, and this is just like catfile(). On other OSs,
the $volume become significant.
<P></P>
<DT><STRONG><A NAME="item_abs2rel">abs2rel</A></STRONG><BR>
<DD>
Takes a destination path and an optional base path returns a relative path
from the base path to the destination path:
<PRE>
$rel_path = File::Spec->abs2rel( $destination ) ;
$rel_path = File::Spec->abs2rel( $destination, $base ) ;</PRE>
<P>If $base is not present or '', then <A HREF="#cwd()">cwd()</A> is used. If $base is relative,
then it is converted to absolute form using <A HREF="#rel2abs()">rel2abs()</A>. This means that it
is taken to be relative to <EM>cwd()</EM>.</P>
<P>On systems with the concept of a volume, this assumes that both paths
are on the $destination volume, and ignores the $base volume.</P>
<P>On systems that have a grammar that indicates filenames, this ignores the
$base filename as well. Otherwise all path components are assumed to be
directories.</P>
<P>If $path is relative, it is converted to absolute form using <A HREF="#rel2abs()">rel2abs()</A>.
This means that it is taken to be relative to <A HREF="#cwd()">cwd()</A>.</P>
<P>Based on code written by Shigio Yamaguchi.</P>
<P>No checks against the filesystem are made.</P>
<P></P>
<DT><STRONG><A NAME="item_rel2abs">rel2abs</A></STRONG><BR>
<DD>
Converts a relative path to an absolute path.
<PRE>
$abs_path = File::Spec->rel2abs( $destination ) ;
$abs_path = File::Spec->rel2abs( $destination, $base ) ;</PRE>
<P>If $base is not present or '', then <EM>cwd()</EM> is used. If $base is relative,
then it is converted to absolute form using <A HREF="#rel2abs()">rel2abs()</A>. This means that it
is taken to be relative to <A HREF="#cwd()">cwd()</A>.</P>
<P>Assumes that both paths are on the $base volume, and ignores the
$destination volume.</P>
<P>On systems that have a grammar that indicates filenames, this ignores the
$base filename as well. Otherwise all path components are assumed to be
directories.</P>
<P>If $path is absolute, it is cleaned up and returned using <A HREF="#canonpath()">canonpath()</A>.</P>
<P>Based on code written by Shigio Yamaguchi.</P>
<P>No checks against the filesystem are made.</P>
<P></P></DL>
<P>
<HR>
<H1><A NAME="see also">SEE ALSO</A></H1>
<P><A HREF="../../../lib/File/Spec.html">the File::Spec manpage</A></P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> File::Spec::Win32 - methods for Win32 file specs</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>