home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / Perl / Non-RPC / !Perl / lib / zip / File / Spec.pm < prev    next >
Text File  |  1999-04-02  |  3KB  |  122 lines

  1. package File::Spec;
  2.  
  3. require Exporter;
  4.  
  5. @ISA = qw(Exporter);
  6. # Items to export into callers namespace by default. Note: do not export
  7. # names by default without a very good reason. Use EXPORT_OK instead.
  8. # Do not simply export all your public functions/methods/constants.
  9. @EXPORT = qw(
  10.     
  11. );
  12. @EXPORT_OK = qw($Verbose);
  13.  
  14. use strict;
  15. use vars qw(@ISA $VERSION $Verbose);
  16.  
  17. $VERSION = '0.6';
  18.  
  19. $Verbose = 0;
  20.  
  21. require File::Spec::Unix;
  22.  
  23.  
  24. sub load {
  25.     my($class,$OS) = @_;
  26.     if ($OS eq 'VMS') {
  27.         require File::Spec::VMS;
  28.         require VMS::Filespec;
  29.         'File::Spec::VMS'
  30.     } elsif ($OS eq 'os2') {
  31.         require File::Spec::OS2;
  32.         'File::Spec::OS2'
  33.     } elsif ($OS eq 'MacOS') {
  34.         require File::Spec::Mac;
  35.         'File::Spec::Mac'
  36.     } elsif ($OS eq 'MSWin32') {
  37.         require File::Spec::Win32;
  38.         'File::Spec::Win32'
  39.     } elsif ($OS eq 'RISCOS') {
  40.         require File::Spec::RISCOS;
  41.         'File::Spec::RISCOS'
  42.     } else {
  43.         'File::Spec::Unix'
  44.     }
  45. }
  46.  
  47. @ISA = load('File::Spec', $^O);
  48.  
  49. 1;
  50. __END__
  51.  
  52. =head1 NAME
  53.  
  54. File::Spec - portably perform operations on file names
  55.  
  56. =head1 SYNOPSIS
  57.  
  58. C<use File::Spec;>
  59.  
  60. C<$x=File::Spec-E<gt>catfile('a','b','c');>
  61.  
  62. which returns 'a/b/c' under Unix.
  63.  
  64. =head1 DESCRIPTION
  65.  
  66. This module is designed to support operations commonly performed on file
  67. specifications (usually called "file names", but not to be confused with the
  68. contents of a file, or Perl's file handles), such as concatenating several
  69. directory and file names into a single path, or determining whether a path
  70. is rooted. It is based on code directly taken from MakeMaker 5.17, code
  71. written by Andreas KE<ouml>nig, Andy Dougherty, Charles Bailey, Ilya
  72. Zakharevich, Paul Schinder, and others.
  73.  
  74. Since these functions are different for most operating systems, each set of
  75. OS specific routines is available in a separate module, including:
  76.  
  77.     File::Spec::Unix
  78.     File::Spec::Mac
  79.     File::Spec::OS2
  80.     File::Spec::Win32
  81.     File::Spec::VMS
  82.  
  83. The module appropriate for the current OS is automatically loaded by
  84. File::Spec. Since some modules (like VMS) make use of OS specific
  85. facilities, it may not be possible to load all modules under all operating
  86. systems.
  87.  
  88. Since File::Spec is object oriented, subroutines should not called directly,
  89. as in:
  90.  
  91.     File::Spec::catfile('a','b');
  92.     
  93. but rather as class methods:
  94.  
  95.     File::Spec->catfile('a','b');
  96.  
  97. For a reference of available functions, please consult L<File::Spec::Unix>,
  98. which contains the entire set, and inherited by the modules for other
  99. platforms. For further information, please see L<File::Spec::Mac>,
  100. L<File::Spec::OS2>, L<File::Spec::Win32>, L<File::Spec::VMS>., or 
  101. L<File::Spec::RISCOS>.
  102.  
  103. =head1 SEE ALSO
  104.  
  105. File::Spec::Unix, File::Spec::Mac, File::Spec::OS2, File::Spec::Win32,
  106. File::Spec::VMS, ExtUtils::MakeMaker
  107.  
  108. =head1 AUTHORS
  109.  
  110. Kenneth Albanowski <F<kjahds@kjahds.com>>, Andy Dougherty
  111. <F<doughera@lafcol.lafayette.edu>>, Andreas KE<ouml>nig
  112. <F<A.Koenig@franz.ww.TU-Berlin.DE>>, Tim Bunce <F<Tim.Bunce@ig.co.uk>>. VMS
  113. support by Charles Bailey <F<bailey@newman.upenn.edu>>.  OS/2 support by
  114. Ilya Zakharevich <F<ilya@math.ohio-state.edu>>. Mac support by Paul Schinder
  115. <F<schinder@pobox.com>>. RISC OS support by Nicholas Clark
  116. <F<nick@unfortu.net>>
  117.  
  118. =cut
  119.  
  120.  
  121. 1;
  122.