develooper Front page | perl.perl5.porters | Postings from May 2003

[perl #942] File::Spec niggles (5.004_05, 5.005_03, 5.005_57)

From:
Casey West
Date:
May 9, 2003 10:08
Subject:
[perl #942] File::Spec niggles (5.004_05, 5.005_03, 5.005_57)
Message ID:
rt-942-57087.5.73712071384719@bugs6.perl.org
[RT_System - Tue Jul 25 06:06:23 2000]:

Could a VMS knowlegable person please tell me in what order the temp
dirs should be checked?  If they should be flip-flopped I'll supply the appropriate
patch to the latest File::Spec::VMS.  Thanks.

  Casey West (bug patrol)

> All of the issues listed in this bug appear to be fixed in 5.6.0, except
> for:
> >File::Spec::VMS::tmpdir is documented (and implemented) as
> >
> >     Returns a string representation of the first writable directory
> >     from the following list or '' if none are writable:
> >
> >         /sys$scratch
> >         $ENV{TMPDIR}
> >
> > This differs from all other File::Spec::*, which always put $ENV{TMPDIR}
> > first.    Is there a good reason for this non-portability, in a module
> > specifically meant to avoid this sort of thing?
> 
> This patch changes that behaviour to match the others.  Is this correct for
> VMS?  If not, I suggest someone put a note in the documentation explaining
> why not.
> 
> diff -uir perl-5.6.0/lib/File/Spec/VMS.pm perl-5.6.work/lib/File/Spec/VMS.pm
> --- perl-5.6.0/lib/File/Spec/VMS.pm     Tue Mar 21 03:55:48 2000
> +++ perl-5.6.work/lib/File/Spec/VMS.pm  Tue Jul 25 16:02:35 2000
> @@ -251,15 +251,15 @@
>  Returns a string representation of the first writable directory
>  from the following list or '' if none are writable:
>  
> -    sys$scratch
>      $ENV{TMPDIR}
> +    sys$scratch
>  
>  =cut
>  
>  my $tmpdir;
>  sub tmpdir {
>      return $tmpdir if defined $tmpdir;
> -    foreach ('sys$scratch', $ENV{TMPDIR}) {
> +    foreach ($ENV{TMPDIR}, 'sys$scratch') {
>         next unless defined && -d && -w _;
>         $tmpdir = $_;
>         last;
> 
> 
> -spp
> 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About