Leaked source code of windows server 2003
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.

62 lines
1.2 KiB

  1. package File::Spec::OS2;
  2. use strict;
  3. use vars qw(@ISA $VERSION);
  4. require File::Spec::Unix;
  5. $VERSION = '1.1';
  6. @ISA = qw(File::Spec::Unix);
  7. sub devnull {
  8. return "/dev/nul";
  9. }
  10. sub case_tolerant {
  11. return 1;
  12. }
  13. sub file_name_is_absolute {
  14. my ($self,$file) = @_;
  15. return scalar($file =~ m{^([a-z]:)?[\\/]}is);
  16. }
  17. sub path {
  18. my $path = $ENV{PATH};
  19. $path =~ s:\\:/:g;
  20. my @path = split(';',$path);
  21. foreach (@path) { $_ = '.' if $_ eq '' }
  22. return @path;
  23. }
  24. my $tmpdir;
  25. sub tmpdir {
  26. return $tmpdir if defined $tmpdir;
  27. my $self = shift;
  28. foreach (@ENV{qw(TMPDIR TEMP TMP)}, qw(/tmp /)) {
  29. next unless defined && -d;
  30. $tmpdir = $_;
  31. last;
  32. }
  33. $tmpdir = '' unless defined $tmpdir;
  34. $tmpdir =~ s:\\:/:g;
  35. $tmpdir = $self->canonpath($tmpdir);
  36. return $tmpdir;
  37. }
  38. 1;
  39. __END__
  40. =head1 NAME
  41. File::Spec::OS2 - methods for OS/2 file specs
  42. =head1 SYNOPSIS
  43. require File::Spec::OS2; # Done internally by File::Spec if needed
  44. =head1 DESCRIPTION
  45. See File::Spec::Unix for a documentation of the methods provided
  46. there. This package overrides the implementation of these methods, not
  47. the semantics.