Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
2.9 KiB

  1. package File::Spec;
  2. require Exporter;
  3. @ISA = qw(Exporter);
  4. # Items to export into callers namespace by default. Note: do not export
  5. # names by default without a very good reason. Use EXPORT_OK instead.
  6. # Do not simply export all your public functions/methods/constants.
  7. @EXPORT = qw(
  8. );
  9. @EXPORT_OK = qw($Verbose);
  10. use strict;
  11. use vars qw(@ISA $VERSION $Verbose);
  12. $VERSION = '0.6';
  13. $Verbose = 0;
  14. require File::Spec::Unix;
  15. sub load {
  16. my($class,$OS) = @_;
  17. if ($OS eq 'VMS') {
  18. require File::Spec::VMS;
  19. require VMS::Filespec;
  20. 'File::Spec::VMS'
  21. } elsif ($OS eq 'os2') {
  22. require File::Spec::OS2;
  23. 'File::Spec::OS2'
  24. } elsif ($OS eq 'MacOS') {
  25. require File::Spec::Mac;
  26. 'File::Spec::Mac'
  27. } elsif ($OS eq 'MSWin32') {
  28. require File::Spec::Win32;
  29. 'File::Spec::Win32'
  30. } else {
  31. 'File::Spec::Unix'
  32. }
  33. }
  34. @ISA = load('File::Spec', $^O);
  35. 1;
  36. __END__
  37. =head1 NAME
  38. File::Spec - portably perform operations on file names
  39. =head1 SYNOPSIS
  40. C<use File::Spec;>
  41. C<$x=File::Spec-E<gt>catfile('a','b','c');>
  42. which returns 'a/b/c' under Unix.
  43. =head1 DESCRIPTION
  44. This module is designed to support operations commonly performed on file
  45. specifications (usually called "file names", but not to be confused with the
  46. contents of a file, or Perl's file handles), such as concatenating several
  47. directory and file names into a single path, or determining whether a path
  48. is rooted. It is based on code directly taken from MakeMaker 5.17, code
  49. written by Andreas KE<ouml>nig, Andy Dougherty, Charles Bailey, Ilya
  50. Zakharevich, Paul Schinder, and others.
  51. Since these functions are different for most operating systems, each set of
  52. OS specific routines is available in a separate module, including:
  53. File::Spec::Unix
  54. File::Spec::Mac
  55. File::Spec::OS2
  56. File::Spec::Win32
  57. File::Spec::VMS
  58. The module appropriate for the current OS is automatically loaded by
  59. File::Spec. Since some modules (like VMS) make use of OS specific
  60. facilities, it may not be possible to load all modules under all operating
  61. systems.
  62. Since File::Spec is object oriented, subroutines should not called directly,
  63. as in:
  64. File::Spec::catfile('a','b');
  65. but rather as class methods:
  66. File::Spec->catfile('a','b');
  67. For a reference of available functions, pleaes consult L<File::Spec::Unix>,
  68. which contains the entire set, and inherited by the modules for other
  69. platforms. For further information, please see L<File::Spec::Mac>,
  70. L<File::Spec::OS2>, L<File::Spec::Win32>, or L<File::Spec::VMS>.
  71. =head1 SEE ALSO
  72. File::Spec::Unix, File::Spec::Mac, File::Spec::OS2, File::Spec::Win32,
  73. File::Spec::VMS, ExtUtils::MakeMaker
  74. =head1 AUTHORS
  75. Kenneth Albanowski <F<[email protected]>>, Andy Dougherty
  76. <F<[email protected]>>, Andreas KE<ouml>nig
  77. <F<[email protected]>>, Tim Bunce <F<[email protected]>>. VMS
  78. support by Charles Bailey <F<[email protected]>>. OS/2 support by
  79. Ilya Zakharevich <F<[email protected]>>. Mac support by Paul Schinder
  80. <F<[email protected]>>.
  81. =cut
  82. 1;