1 package File::Spec::Cygwin;
4 use vars qw(@ISA $VERSION);
5 require File::Spec::Unix;
9 @ISA = qw(File::Spec::Unix);
13 File::Spec::Cygwin - methods for Cygwin file specs
17 require File::Spec::Cygwin; # Done internally by File::Spec if needed
21 See L<File::Spec> and L<File::Spec::Unix>. This package overrides the
22 implementation of these methods, not the semantics.
24 This module is still in beta. Cygwin-knowledgeable folks are invited
25 to offer patches and suggestions.
35 Any C<\> (backslashes) are converted to C</> (forward slashes),
36 and then File::Spec::Unix canonpath() is called on the result.
44 # Handle network path names beginning with double slash
46 if ( $path =~ s@^(//[^/]+)(?:/|\z)@/@s ) {
49 return $node . $self->SUPER::canonpath($path);
55 # Don't create something that looks like a //network/path
56 if ($_[0] eq '/' or $_[0] eq '\\') {
58 return $self->SUPER::catdir('', @_);
61 $self->SUPER::catdir(@_);
66 =item file_name_is_absolute
68 True is returned if the file name begins with C<drive_letter:>,
69 and if not, File::Spec::Unix file_name_is_absolute() is called.
74 sub file_name_is_absolute {
75 my ($self,$file) = @_;
76 return 1 if $file =~ m{^([a-z]:)?[\\/]}is; # C:/test
77 return $self->SUPER::file_name_is_absolute($file);
80 =item tmpdir (override)
82 Returns a string representation of the first existing directory
83 from the following list:
89 Since Perl 5.8.0, if running under taint mode, and if the environment
90 variables are tainted, they are not used.
96 return $tmpdir if defined $tmpdir;
97 $tmpdir = $_[0]->_tmpdir( $ENV{TMPDIR}, "/tmp", 'C:/temp' );
104 Copyright (c) 2004 by the Perl 5 Porters. All rights reserved.
106 This program is free software; you can redistribute it and/or modify
107 it under the same terms as Perl itself.