Date: Monday March 04, 2019 @ 22:38 Author: argrath Update of /cvsroot/perldocjp/docs/modules/PathTools-3.30/File In directory sf-cvs:/tmp/cvs-serv125387/modules/PathTools-3.30/File Added Files: Spec.pod Log Message: File-Spec-3.30 =================================================================== File: Spec.pod Status: Up-to-date Working revision: 1.1 Mon Mar 4 13:38:47 2019 Repository revision: 1.1 /cvsroot/perldocjp/docs/modules/PathTools-3.30/File/Spec.pod,v Existing Tags: No Tags Exist -------------- next part -------------- Index: docs/modules/PathTools-3.30/File/Spec.pod diff -u /dev/null docs/modules/PathTools-3.30/File/Spec.pod:1.1 --- /dev/null Mon Mar 4 22:38:47 2019 +++ docs/modules/PathTools-3.30/File/Spec.pod Mon Mar 4 22:38:47 2019 @@ -0,0 +1,698 @@ + +=encoding euc-jp + +=head1 NAME + +=begin original + +File::Spec - portably perform operations on file names + +=end original + +File::Spec - ¥Õ¥¡¥¤¥ë̾¤Ë´Ø¤·¤Æ°Ü¿¢À¤Î¤¢¤ëÁàºî¤ò¹Ô¤¦ + +=head1 SYNOPSIS + + use File::Spec; + + $x=File::Spec->catfile('a', 'b', 'c'); + +=begin original + +which returns 'a/b/c' under Unix. Or: + +=end original + +¤³¤ì¤Ï Unix ¤Ç¤Ï 'a/b/c' ¤òÊÖ¤·¤Þ¤¹¡£ +¤¢¤ë¤¤¤Ï: + + use File::Spec::Functions; + + $x = catfile('a', 'b', 'c'); + +=head1 DESCRIPTION + +=begin original + +This module is designed to support operations commonly performed on file +specifications (usually called "file names", but not to be confused with the +contents of a file, or Perl's file handles), such as concatenating several +directory and file names into a single path, or determining whether a path +is rooted. It is based on code directly taken from MakeMaker 5.17, code +written by Andreas KE<ouml>nig, Andy Dougherty, Charles Bailey, Ilya +Zakharevich, Paul Schinder, and others. + +=end original + +¤³¤Î¥â¥¸¥å¡¼¥ë¤Ï¡¢¥Õ¥¡¥¤¥ë»ØÄê (file specifications) (Ä̾ï¡Ö¥Õ¥¡¥¤¥ë̾¡×¤È +¸Æ¤Ð¤ì¤Þ¤¹¤¬¡¢¥Õ¥¡¥¤¥ë¤ÎÆâÍƤäPerl ¤Î¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤È +º®Æ±¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤) ¤ËÂФ·¤Æ¡¢ +Ê£¿ô¤Î¥Ç¥£¥ì¥¯¥È¥ê¤È¥Õ¥¡¥¤¥ë̾¤Îñ°ì¤Î¥Ñ¥¹¤Ø¤Î·ë¹ç¡¢ +¥Ñ¥¹¤¬¥ë¡¼¥È¤«¤é¤«¤Î·èÄê¡¢¤È¤¤¤Ã¤¿°ìÈÌŪ¤Ë¹Ô¤ï¤ì¤ëÁàºî¤Ë +Âбþ¤¹¤ë¤¿¤á¤ËÀ߷פµ¤ì¤Æ¤¤¤Þ¤¹¡£ +¤³¤ì¤Ï Andreas KE<ouml>nig, Andy Dougherty, Charles Bailey, Ilya +Zakharevich, Paul Schinder ¤Ê¤É¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿ MakeMaker 5.17 ¤«¤é +ľÀÜ¥³¡¼¥É¤ò¼è¤Ã¤Æ¤¤¤Þ¤¹¡£ + +=begin original + +Since these functions are different for most operating systems, each set of +OS specific routines is available in a separate module, including: + +=end original + +¤³¤ì¤é¤Î´Ø¿ô¤Ï¤Û¤È¤ó¤É¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¤Î¤Ç¡¢ +¤½¤ì¤¾¤ì¤Î OS ¸ÇͤΥ롼¥Á¥ó¤Ï¼¡¤Î¤è¤¦¤ÊÊÌ¡¹¤Î¥â¥¸¥å¡¼¥ë¤ÇÍøÍѲÄǽ¤Ç¤¹: + + File::Spec::Unix + File::Spec::Mac + File::Spec::OS2 + File::Spec::Win32 + File::Spec::VMS + +=begin original + +The module appropriate for the current OS is automatically loaded by +File::Spec. Since some modules (like VMS) make use of facilities available +only under that OS, it may not be possible to load all modules under all +operating systems. + +=end original + +¸½ºß¤Î OS ¤Î¤¿¤á¤ÎŬÀڤʥ⥸¥å¡¼¥ë¤Ï File::Spec ¤Ë¤è¤Ã¤Æ¼«Æ°Åª¤Ë +Æɤ߹þ¤Þ¤ì¤Þ¤¹¡£ +(VMS ¤Î¤è¤¦¤Ê) °ìÉô¤Î¥â¥¸¥å¡¼¥ë¤Ï¤½¤Î OS ¤Ç¤Î¤ßÍøÍѲÄǽ¤Êµ¡Ç½¤ò +»È¤Ã¤Æ¤¤¤ë¤Î¤Ç¡¢Á´¤Æ¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤ÇÁ´¤Æ¤Î¥â¥¸¥å¡¼¥ë¤¬ +Æɤ߹þ¤Þ¤ì¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ + +=begin original + +Since File::Spec is object oriented, subroutines should not be called directly, +as in: + +=end original + +File::Spec ¤Ï¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þ¤Ê¤Î¤Ç¡¢¥µ¥Ö¥ë¡¼¥Á¥ó¤Ï¼¡¤Î¤è¤¦¤Ë +ľÀܸƤӽФµ¤ì¤ë¤Ù¤¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó: + + File::Spec::catfile('a','b'); + +=begin original + +but rather as class methods: + +=end original + +¼¡¤Î¤è¤¦¤Ë¥¯¥é¥¹¥á¥½¥Ã¥É¤È¤·¤Æ¸Æ¤Ó½Ð¤·¤Æ¤¯¤À¤µ¤¤: + + File::Spec->catfile('a','b'); + +=begin original + +For simple uses, L<File::Spec::Functions> provides convenient functional +forms of these methods. + +=end original + +ñ½ã¤ÊÍÑÅӤΤ¿¤á¤Ë¡¢L<File::Spec::Functions> ¤¬¤³¤ì¤é¤Î¥á¥½¥Ã¥É¤ÎÊØÍø¤Ê +´Ø¿ô·Á¼°¤òÄ󶡤·¤Þ¤¹¡£ + +=head1 METHODS + +(¥á¥½¥Ã¥É) + +=over 2 + +=item canonpath +X<canonpath> + +=begin original + +No physical check on the filesystem, but a logical cleanup of a +path. + +=end original + +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤ÎʪÍýŪ¤Ê¥Á¥§¥Ã¥¯¤Ï¤»¤º¤Ë¡¢¥Ñ¥¹¤òÏÀÍýŪ¤ËÀ°Íý¤·¤Þ¤¹¡£ + + $cpath = File::Spec->canonpath( $path ) ; + +=begin original + +Note that this does *not* collapse F<x/../y> sections into F<y>. This +is by design. If F</foo> on your system is a symlink to F</bar/baz>, +then F</foo/../quux> is actually F</bar/quux>, not F</quux> as a naive +F<../>-removal would give you. If you want to do this kind of +processing, you probably want C<Cwd>'s C<realpath()> function to +actually traverse the filesystem cleaning up paths like this. + +=end original + +¤³¤ì¤Ï F<x/../y> ¤ò F<y> ¤Ëû½Ì¡Ö¤·¤Ê¤¤¡×¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ +¤³¤ì¤Ï»ÅÍͤǤ¹¡£ +¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤Ç¤Î F</foo> ¤¬ F</bar/baz> ¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¡¢ +F</foo/../quux> ¤Ï¡¢Ã±½ã¤Ë F<../> ¤òºï½ü¤·¤¿·ë²Ì¤È¤Ê¤ë F</quux> ¤Ç¤Ï¤Ê¤¯¡¢ +¼ÂºÝ¤Ë¤Ï F</bar/quux> ¤È¤Ê¤ê¤Þ¤¹¡£ +¤³¤Î¤è¤¦¤Ê½èÍý¤ò¤·¤¿¤¤¾ì¹ç¤Ï¡¢¤³¤Î¤è¤¦¤Ê¥Ñ¥¹¤ò¼ÂºÝ¤Ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +¤¿¤É¤Ã¤ÆÀ°Íý¤¹¤ë C<Cwd> ¤Î C<realpath()> ¤ò»È¤¦¤Ù¤¤Ç¤·¤ç¤¦¡£ + +=item catdir +X<catdir> + +=begin original + +Concatenate two or more directory names to form a complete path ending +with a directory. But remove the trailing slash from the resulting +string, because it doesn't look good, isn't necessary and confuses +OS/2. Of course, if this is the root directory, don't cut off the +trailing slash :-) + +=end original + +Æó¤Ä°Ê¾å¤Î¥Ç¥£¥ì¥¯¥È¥ê̾¤ò¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç½ª¤ï¤ë´°Á´¤Ê¥Ñ¥¹¤Î·Á¤Ë +·ë¹ç¤·¤Þ¤¹¡£ +¤·¤«¤·¡¢·ë²Ì¤Îʸ»úÎó¤ÎËöÈø¤Î¥¹¥é¥Ã¥·¥å¤Ïºï½ü¤µ¤ì¤Þ¤¹; +¸«¤¿Ìܤ¬Îɤ¯¤Ê¤¯¡¢ÉÔÍפǤ¢¤ê¡¢OS/2 ¤òº®Í𤵤»¤ë¤«¤é¤Ç¤¹¡£ +¤â¤Á¤í¤ó¡¢¤³¤ì¤¬¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ï¡¢ËöÈø¤Î¥¹¥é¥Ã¥·¥å¤Ï +ºï½ü¤µ¤ì¤Þ¤»¤ó :-) + + $path = File::Spec->catdir( @directories ); + +=item catfile +X<catfile> + +=begin original + +Concatenate one or more directory names and a filename to form a +complete path ending with a filename + +=end original + +°ì¤Ä°Ê¾å¤Î¥Ç¥£¥ì¥¯¥È¥ê̾¤È¥Õ¥¡¥¤¥ë̾¤ò¡¢¥Õ¥¡¥¤¥ë̾¤Ç½ª¤ï¤ë +´°Á´¤Ê¥Ñ¥¹¤Î·Á¤Ë·ë¹ç¤·¤Þ¤¹¡£ + + $path = File::Spec->catfile( @directories, $filename ); + +=item curdir +X<curdir> + +=begin original + +Returns a string representation of the current directory. + +=end original + +¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Îʸ»úÎóɽ¸½¤òÊÖ¤·¤Þ¤¹¡£ + + $curdir = File::Spec->curdir(); + +=item devnull +X<devnull> + +=begin original + +Returns a string representation of the null device. + +=end original + +¥Ì¥ë¥Ç¥Ð¥¤¥¹¤Îʸ»úÎóɽ¸½¤òÊÖ¤·¤Þ¤¹¡£ + + $devnull = File::Spec->devnull(); + +=item rootdir +X<rootdir> + +=begin original + +Returns a string representation of the root directory. + +=end original + +¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Îʸ»úÎóɽ¸½¤òÊÖ¤·¤Þ¤¹¡£ + + $rootdir = File::Spec->rootdir(); + +=item tmpdir +X<tmpdir> + +=begin original + +Returns a string representation of the first writable directory from a +list of possible temporary directories. Returns the current directory +if no writable temporary directories are found. The list of directories +checked depends on the platform; e.g. File::Spec::Unix checks C<$ENV{TMPDIR}> +(unless taint is on) and F</tmp>. + +=end original + +°ì»þ¥Ç¥£¥ì¥¯¥È¥ê¤Î¸õÊä¤Î°ìÍ÷¤«¤éºÇ½é¤Î½ñ¤¹þ¤ß²Äǽ¥Ç¥£¥ì¥¯¥È¥ê¤Î +ʸ»úÎóɽ¸½¤òÊÖ¤·¤Þ¤¹¡£ +¤â¤·½ñ¤¹þ¤ß²Äǽ¤Ê°ì»þ¥Ç¥£¥ì¥¯¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï +¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤òÊÖ¤·¤Þ¤¹¡£ +¥Á¥§¥Ã¥¯¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î°ìÍ÷¤Ï¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ë°Í¸¤·¤Þ¤¹; +Î㤨¤Ð¡¢File::Spec::Unix ¤Ï C<$ENV{TMPDIR}> (±øÀ÷¥Á¥§¥Ã¥¯¤¬¥ª¥ó¤Ç¤Ê¤¤¾ì¹ç)¤È +F</tmp> ¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£ + + $tmpdir = File::Spec->tmpdir(); + +=item updir +X<updir> + +=begin original + +Returns a string representation of the parent directory. + +=end original + +¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Îʸ»úÎóɽ¸½¤òÊÖ¤·¤Þ¤¹¡£ + + $updir = File::Spec->updir(); + +=item no_upwards + +=begin original + +Given a list of file names, strip out those that refer to a parent +directory. (Does not strip symlinks, only '.', '..', and equivalents.) + +=end original + +¥Õ¥¡¥¤¥ë̾¤Î¥ê¥¹¥È¤ò¼è¤Ã¤Æ¡¢¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¤â¤Î¤ò +¼è¤ê½ü¤¤Þ¤¹¡£ +(¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ï¼è¤ê½ü¤¤Þ¤»¤ó; '.', '..' ¤ª¤è¤ÓÅù²Áʪ¤Î¤ß¤Ç¤¹¡£) + + @paths = File::Spec->no_upwards( @paths ); + +=item case_tolerant + +=begin original + +Returns a true or false value indicating, respectively, that alphabetic +case is not or is significant when comparing file specifications. + +=end original + +¥Õ¥¡¥¤¥ë»ØÄê¤òÈæ³Ó¤¹¤ë¤È¤¤Ë¡¢±Ñ»ú¤ÎÂçʸ»ú¾®Ê¸»ú¤òǧ¼±¤¹¤ë¤«¤É¤¦¤«¤ò¼¨¤¹ +¿¿¤Þ¤¿¤Ïµ¶¤ÎÃͤòÊÖ¤·¤Þ¤¹¡£ + + $is_case_tolerant = File::Spec->case_tolerant(); + +=item file_name_is_absolute + +=begin original + +Takes as its argument a path, and returns true if it is an absolute path. + +=end original + +¥Ñ¥¹¤ò°ú¿ô¤È¤·¤Æ¼è¤ê¡¢¤³¤ì¤¬ÀäÂХѥ¹¤Î¾ì¹ç¤Ë¿¿¤òÊÖ¤·¤Þ¤¹¡£ + + $is_absolute = File::Spec->file_name_is_absolute( $path ); + +=begin original + +This does not consult the local filesystem on Unix, Win32, OS/2, or +Mac OS (Classic). It does consult the working environment for VMS +(see L<File::Spec::VMS/file_name_is_absolute>). + +=end original + +¤³¤ì¤Ï¡¢Unix, Win32, OS/2, Mac OS (Classic) ¤Ç¤Ï¥í¡¼¥«¥ë¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +»²¾È¤·¤Þ¤»¤ó¡£ +VMS ¤ÎÆ°ºî´Ä¶¤Ç¤Ï»²¾È¤·¤Þ¤¹ (L<File::Spec::VMS/file_name_is_absolute> ¤ò +»²¾È¤·¤Æ¤¯¤À¤µ¤¤)¡£ + +=item path +X<path> + +=begin original + +Takes no argument. Returns the environment variable C<PATH> (or the local +platform's equivalent) as a list. + +=end original + +°ú¿ô¤ò¼è¤ê¤Þ¤»¤ó¡£ +C<PATH> ´Ä¶ÊÑ¿ô (¤Þ¤¿¤Ï¥í¡¼¥«¥ë¤Ê¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤ÎÅù²Áʪ) ¤ò +¥ê¥¹¥È¤È¤·¤ÆÊÖ¤·¤Þ¤¹¡£ + + @PATH = File::Spec->path(); + +=item join +X<join, path> + +=begin original + +join is the same as catfile. + +=end original + +join ¤Ï catfile ¤ÈƱ¤¸¤Ç¤¹¡£ + +=item splitpath +X<splitpath> X<split, path> + +=begin original + +Splits a path in to volume, directory, and filename portions. On systems +with no concept of volume, returns '' for volume. + +=end original + +¥Ñ¥¹¤ò¥Ü¥ê¥å¡¼¥à¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥Õ¥¡¥¤¥ë̾¤ÎÉôʬ¤Ëʬ³ä¤·¤Þ¤¹¡£ +¥Ü¥ê¥å¡¼¥à¤Î³µÇ°¤¬¤Ê¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥Ü¥ê¥å¡¼¥à¤È¤·¤Æ '' ¤òÊÖ¤·¤Þ¤¹¡£ + + ($volume,$directories,$file) = File::Spec->splitpath( $path ); + ($volume,$directories,$file) = File::Spec->splitpath( $path, $no_file ); + +=begin original + +For systems with no syntax differentiating filenames from directories, +assumes that the last file is a path unless C<$no_file> is true or a +trailing separator or F</.> or F</..> is present. On Unix, this means that C<$no_file> +true makes this return ( '', $path, '' ). + +=end original + +¥Õ¥¡¥¤¥ë̾¤È¥Ç¥£¥ì¥¯¥È¥ê¤Ëʸˡ¾å¤Î°ã¤¤¤¬¤Ê¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +C<$no_file> ¤¬¿¿¤Ç¤¢¤Ã¤¿¤êËöÈø¤Î¶èÀÚ¤êʸ»ú¤ä F</.> or F</..> ¤¬¤¢¤Ã¤¿¤ê¡¢ +¤È¤¤¤¦¤³¤È¤¬¤Ê¤±¤ì¤Ð¡¢ºÇ¸å¤Î¥Õ¥¡¥¤¥ë¤¬¥Ñ¥¹¤Ç¤¢¤ë¤È²¾Äꤷ¤Þ¤¹¡£ +Unix ¤Ç¤Ï¡¢C<$no_file> ¤¬¿¿¤Î¾ì¹ç¡¢¤³¤ì¤Ï ( '', $path, '' ) ¤ò +ÊÖ¤¹¤È¤¤¤¦¤³¤È¤Ç¤¹¡£ + +=begin original + +The directory portion may or may not be returned with a trailing '/'. + +=end original + +¥Ç¥£¥ì¥¯¥È¥êÉô¤ÏËöÈø¤Î '/' ¤¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤·¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£ + +=begin original + +The results can be passed to L</catpath()> to get back a path equivalent to +(usually identical to) the original path. + +=end original + +·ë²Ì¤Ï¡¢¸µ¤Î¥Ñ¥¹¤ÈÅù²Á¤Ê (Ä̾ï¤ÏƱ¤¸) ¥Ñ¥¹¤ò¼è¤êÌ᤹¤¿¤á¤Ë +L</catpath()> ¤ËÅϤ»¤Þ¤¹¡£ + +=item splitdir +X<splitdir> X<split, dir> + +=begin original + +The opposite of L</catdir()>. + +=end original + +L</catdir()> ¤ÎµÕ¤Ç¤¹¡£ + + @dirs = File::Spec->splitdir( $directories ); + +=begin original + +C<$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. + +=end original + +¥Ü¥ê¥å¡¼¥à¤Î³µÇ°¤¬¤¢¤ë¤«¡¢¥Õ¥¡¥¤¥ë¤È¥Ç¥£¥ì¥¯¥È¥ê¤Ë°ã¤¤¤¬¤¢¤ë¥Ñ¥¹Ê¸Ë¡¤Î +¥·¥¹¥Æ¥à¤Î¾ì¹ç¡¢C<$directories> ¤Ï¥Ñ¥¹¤ÎÍ£°ì¤Î +¥Ç¥£¥ì¥¯¥È¥êÉô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ + +=begin original + +Unlike just splitting the directories on the separator, empty +directory names (C<''>) can be returned, because these are significant +on some OSes. + +=end original + +ñ¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤ò¶èÀÚ¤êʸ»ú¤Çʬ³ä¤¹¤ë¤Î¤È°Û¤Ê¤ê¡¢¶õ¥Ç¥£¥ì¥¯¥È¥ê̾ +(C<''>) ¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹; °ìÉô¤Î OS ¤Ç¤Ï¤³¤ì¤¬°ÕÌ£¤ò»ý¤Ä¤«¤é¤Ç¤¹¡£ + +=item catpath() + +=begin original + +Takes volume, directory and file portions and returns an entire path. Under +Unix, C<$volume> is ignored, and directory and file are concatenated. A '/' is +inserted if need be. On other OSes, C<$volume> is significant. + +=end original + +¥Ü¥ê¥å¡¼¥à¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥Õ¥¡¥¤¥ëÉô¤ò¼è¤Ã¤Æ¡¢¥Ñ¥¹Á´ÂΤòÊÖ¤·¤Þ¤¹¡£ +Unix ¤Ç¤Ï¡¢C<$volume> ¤Ï̵»ë¤µ¤ì¡¢¥Ç¥£¥ì¥¯¥È¥ê¤È¥Õ¥¡¥¤¥ë¤Ï·ë¹ç¤µ¤ì¤Þ¤¹¡£ +ɬÍפʾì¹ç¤Ï '/' ¤¬ÁÞÆþ¤µ¤ì¤Þ¤¹¡£ +¤½¤Î¾¤Î OS ¤Ç¤Ï¡¢C<$volume> ¤Ï°ÕÌ£¤ò»ý¤Á¤Þ¤¹¡£ + + $full_path = File::Spec->catpath( $volume, $directory, $file ); + +=item abs2rel +X<abs2rel> X<absolute, path> X<relative, path> + +=begin original + +Takes a destination path and an optional base path returns a relative path +from the base path to the destination path: + +=end original + +ÌÜɸ¥Ñ¥¹¤È¥ª¥×¥·¥ç¥ó¤Î´ðÄì¥Ñ¥¹¤ò¼è¤Ã¤Æ¡¢´ðÄì¥Ñ¥¹¤«¤éÌÜɸ¥Ñ¥¹¤Ø¤Î +ÁêÂХѥ¹¤òÊÖ¤·¤Þ¤¹: + + $rel_path = File::Spec->abs2rel( $path ) ; + $rel_path = File::Spec->abs2rel( $path, $base ) ; + +=begin original + +If C<$base> is not present or '', then L<Cwd::cwd()|Cwd> is used. If C<$base> is +relative, then it is converted to absolute form using +L</rel2abs()>. This means that it is taken to be relative to +L<Cwd::cwd()|Cwd>. + +=end original + +C<$base> ¤¬Â¸ºß¤·¤Ê¤¤¤« '' ¤Î¾ì¹ç¡¢L<Cwd::cwd()|Cwd> ¤¬»È¤ï¤ì¤Þ¤¹¡£ +C<$base> ¤¬ÁêÂФξì¹ç¡¢L</rel2abs()> ¤ò»È¤Ã¤ÆÀäÂзÁ¼°¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£ +¤Ä¤Þ¤ê¡¢L<Cwd::cwd()|Cwd> ¤«¤é¤ÎÁêÂХѥ¹¤Ë¤Ê¤ê¤Þ¤¹¡£ + +=begin original + +On systems with the concept of volume, if C<$path> and C<$base> appear to be +on two different volumes, we will not attempt to resolve the two +paths, and we will instead simply return C<$path>. Note that previous +versions of this module ignored the volume of C<$base>, which resulted in +garbage results part of the time. + +=end original + +¥Ü¥ê¥å¡¼¥à¤Î³µÇ°¤¬¤¢¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢C<$path> ¤È C<$base> ¤Ë°Û¤Ê¤Ã¤¿ +¥Ü¥ê¥å¡¼¥à¤¬¤¢¤ë¤è¤¦¤Ë¸«¤¨¤ë¾ì¹ç¡¢Æó¤Ä¤Î¥Ñ¥¹¤ò²ò·è¤·¤è¤¦¤È¤»¤º¤Ë¡¢ +ñ¤Ë C<$path> ¤òÊÖ¤·¤Þ¤¹¡£ +¤³¤Î¥â¥¸¥å¡¼¥ë¤Î°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢C<$base> ¤Î¥Ü¥ê¥å¡¼¥à¤ò +̵»ë¤·¤Æ¤¤¤¿¤¿¤á¡¢°ì»þ´ü²õ¤ì¤¿·ë²Ì¤òÊÖ¤·¤Æ¤¤¤Þ¤·¤¿¡£ + +=begin original + +On systems that have a grammar that indicates filenames, this ignores the +C<$base> filename as well. Otherwise all path components are assumed to be +directories. + +=end original + +¥Õ¥¡¥¤¥ë̾¤ò¼¨¤¹Ê¸Ë¡¤¬¤¢¤ë¾ì¹ç¡¢C<$base> ¥Õ¥¡¥¤¥ë̾¤â̵»ë¤µ¤ì¤Þ¤¹¡£ +¤µ¤â¤Ê¤±¤ì¤ÐÁ´¤Æ¤Î¥Ñ¥¹Í×ÁǤϥǥ£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤È²¾Äꤵ¤ì¤Þ¤¹¡£ + +=begin original + +If C<$path> is relative, it is converted to absolute form using L</rel2abs()>. +This means that it is taken to be relative to L<Cwd::cwd()|Cwd>. + +=end original + +C<$path> ¤¬ÁêÂФξì¹ç¡¢L</rel2abs()> ¤ò»È¤Ã¤ÆÀäÂзÁ¼°¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£ +¤Ä¤Þ¤ê¡¢L<Cwd::cwd()|Cwd> ¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ê¤Þ¤¹¡£ + +=begin original + +No checks against the filesystem are made. On VMS, there is +interaction with the working environment, as logicals and +macros are expanded. + +=end original + +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¤¢¤ë¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤Ï¹Ô¤¤¤Þ¤»¤ó¡£ +VMS ¤Ç¤Ï¡¢ÏÀÍý¤È¥Þ¥¯¥í¤¬³ÈÄ¥¤µ¤ì¤ë¤Î¤Ç¡¢Æ°ºî´Ä¶¤È¤ÎÁê¸ßºîÍѤ¬¤¢¤ê¤Þ¤¹¡£ + +=begin original + +Based on code written by Shigio Yamaguchi. + +=end original + +Shigio Yamaguchi ¤¬½ñ¤¤¤¿¥³¡¼¥É¤ò´ð¤Ë¤·¤Æ¤¤¤Þ¤¹¡£ + +=item rel2abs() +X<rel2abs> X<absolute, path> X<relative, path> + +=begin original + +Converts a relative path to an absolute path. + +=end original + +ÁêÂХѥ¹¤òÀäÂХѥ¹¤ËÊÑ´¹¤·¤Þ¤¹¡£ + + $abs_path = File::Spec->rel2abs( $path ) ; + $abs_path = File::Spec->rel2abs( $path, $base ) ; + +=begin original + +If C<$base> is not present or '', then L<Cwd::cwd()|Cwd> is used. If C<$base> is relative, +then it is converted to absolute form using L</rel2abs()>. This means that it +is taken to be relative to L<Cwd::cwd()|Cwd>. + +=end original + +C<$base> ¤¬Â¸ºß¤·¤Ê¤¤¤« '' ¤Î¾ì¹ç¡¢L<Cwd::cwd()|Cwd> ¤¬»È¤ï¤ì¤Þ¤¹¡£ +C<$base> ¤¬ÁêÂФξì¹ç¡¢L</rel2abs()> ¤ò»È¤Ã¤ÆÀäÂзÁ¼°¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£ +¤Ä¤Þ¤ê¡¢L<Cwd::cwd()|Cwd> ¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ê¤Þ¤¹¡£ + +=begin original + +On systems with the concept of volume, if C<$path> and C<$base> appear to be +on two different volumes, we will not attempt to resolve the two +paths, and we will instead simply return C<$path>. Note that previous +versions of this module ignored the volume of C<$base>, which resulted in +garbage results part of the time. + +=end original + +¥Ü¥ê¥å¡¼¥à¤Î³µÇ°¤¬¤¢¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢C<$path> ¤È C<$base> ¤Ë°Û¤Ê¤Ã¤¿ +¥Ü¥ê¥å¡¼¥à¤¬¤¢¤ë¤è¤¦¤Ë¸«¤¨¤ë¾ì¹ç¡¢Æó¤Ä¤Î¥Ñ¥¹¤ò²ò·è¤·¤è¤¦¤È¤»¤º¤Ë¡¢ +ñ¤Ë C<$path> ¤òÊÖ¤·¤Þ¤¹¡£ +¤³¤Î¥â¥¸¥å¡¼¥ë¤Î°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢C<$base> ¤Î¥Ü¥ê¥å¡¼¥à¤ò +̵»ë¤·¤Æ¤¤¤¿¤¿¤á¡¢°ì»þ´ü²õ¤ì¤¿·ë²Ì¤òÊÖ¤·¤Æ¤¤¤Þ¤·¤¿¡£ + +=begin original + +On systems that have a grammar that indicates filenames, this ignores the +C<$base> filename as well. Otherwise all path components are assumed to be +directories. + +=end original + +¥Õ¥¡¥¤¥ë̾¤ò¼¨¤¹Ê¸Ë¡¤¬¤¢¤ë¾ì¹ç¡¢C<$base> ¥Õ¥¡¥¤¥ë̾¤â̵»ë¤µ¤ì¤Þ¤¹¡£ +¤µ¤â¤Ê¤±¤ì¤ÐÁ´¤Æ¤Î¥Ñ¥¹Í×ÁǤϥǥ£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤È²¾Äꤵ¤ì¤Þ¤¹¡£ + +=begin original + +If C<$path> is absolute, it is cleaned up and returned using L</canonpath()>. + +=end original + +C<$path> ¤¬ÀäÂХѥ¹¤Î¾ì¹ç¡¢L</canonpath()> ¤ò»È¤Ã¤ÆÀ°Íý¤·¤¿¤â¤Î¤òÊÖ¤·¤Þ¤¹¡£ + +=begin original + +No checks against the filesystem are made. On VMS, there is +interaction with the working environment, as logicals and +macros are expanded. + +=end original + +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¤¢¤ë¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤Ï¹Ô¤¤¤Þ¤»¤ó¡£ +VMS ¤Ç¤Ï¡¢ÏÀÍý¤È¥Þ¥¯¥í¤¬³ÈÄ¥¤µ¤ì¤ë¤Î¤Ç¡¢Æ°ºî´Ä¶¤È¤ÎÁê¸ßºîÍѤ¬¤¢¤ê¤Þ¤¹¡£ + +=begin original + +Based on code written by Shigio Yamaguchi. + +=end original + +Shigio Yamaguchi ¤¬½ñ¤¤¤¿¥³¡¼¥É¤ò´ð¤Ë¤·¤Æ¤¤¤Þ¤¹¡£ + +=back + +=begin original + +For further information, please see L<File::Spec::Unix>, +L<File::Spec::Mac>, L<File::Spec::OS2>, L<File::Spec::Win32>, or +L<File::Spec::VMS>. + +=end original + +¤µ¤é¤Ê¤ë¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï¡¢L<File::Spec::Unix>, +L<File::Spec::Mac>, L<File::Spec::OS2>, L<File::Spec::Win32>, +L<File::Spec::VMS> ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ + +=head1 SEE ALSO + +L<File::Spec::Unix>, L<File::Spec::Mac>, L<File::Spec::OS2>, +L<File::Spec::Win32>, L<File::Spec::VMS>, L<File::Spec::Functions>, +L<ExtUtils::MakeMaker> + +=head1 AUTHOR + +=begin original + +Currently maintained by Ken Williams C<< <KWILL****@cpan*****> >>. + +=end original + +¸½ºß¤Î¤È¤³¤í Ken Williams C<< <KWILL****@cpan*****> >> ¤Ë¤è¤Ã¤Æ +Êݼ餵¤ì¤Æ¤¤¤Þ¤¹¡£ + +=begin original + +The vast majority of the code was written by +Kenneth Albanowski C<< <kjahd****@kjahd*****> >>, +Andy Dougherty C<< <dough****@lafay*****> >>, +Andreas KE<ouml>nig C<< <A.Koe****@franz*****> >>, +Tim Bunce C<< <Tim.B****@ig*****> >>. +VMS support by Charles Bailey C<< <baile****@newma*****> >>. +OS/2 support by Ilya Zakharevich C<< <ilya****@math*****> >>. +Mac support by Paul Schinder C<< <schin****@pobox*****> >>, and +Thomas Wegner C<< <wegner_thoma****@yahoo*****> >>. +abs2rel() and rel2abs() written by Shigio Yamaguchi C<< <shigi****@tamac*****> >>, +modified by Barrie Slaymaker C<< <barri****@slays*****> >>. +splitpath(), splitdir(), catpath() and catdir() by Barrie Slaymaker. + +=end original + +ÂçÉôʬ¤Î¥³¡¼¥É¤Ï +Kenneth Albanowski C<< <kjahd****@kjahd*****> >>, +Andy Dougherty C<< <dough****@lafay*****> >>, +Andreas KE<ouml>nig C<< <A.Koe****@franz*****> >>, +Tim Bunce C<< <Tim.B****@ig*****> >> ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤Þ¤·¤¿¡£ +VMS Âбþ¤Ï Charles Bailey C<< <baile****@newma*****> >> ¤Ë¤è¤ë¤â¤Î¤Ç¤¹¡£ +OS/2 Âбþ¤Ï Ilya Zakharevich C<< <ilya****@math*****> >> ¤Ë¤è¤ë +¤â¤Î¤Ç¤¹¡£ +Mac Âбþ¤Ï Paul Schinder C<< <schin****@pobox*****> >> ¤È +Thomas Wegner C<< <wegner_thoma****@yahoo*****> >> ¤Ë¤è¤ë¤â¤Î¤Ç¤¹¡£ +abs2rel() ¤È rel2abs() ¤Ï +Shigio Yamaguchi C<< <shigi****@tamac*****> >> ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¡¢ +Barrie Slaymaker C<< <barri****@slays*****> >> ¤Ë¤è¤Ã¤Æ½¤Àµ¤µ¤ì¤Þ¤·¤¿¡£ +splitpath(), splitdir(), catpath() and catdir() ¤Ï +Barrie Slaymaker ¤Ë¤è¤ë¤â¤Î¤Ç¤¹¡£ + +=head1 COPYRIGHT + +Copyright (c) 2004 by the Perl 5 Porters. All rights reserved. + +This program is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=begin meta + +Translate: SHIRAKATA Kentaro <argra****@ub32*****> +Status: completed + +=end meta + +=cut +