develooper Front page | perl.perl5.porters | Postings from January 2018

Re: [perl #132648] Cwd: different return values between pure perland XS variants

Thread Previous | Thread Next
From:
Tony Cook
Date:
January 16, 2018 23:23
Subject:
Re: [perl #132648] Cwd: different return values between pure perland XS variants
Message ID:
20180116232254.s5kwj2k5httnba6a@mars.tony.develop-help.com
On Tue, Jan 16, 2018 at 10:45:38AM +0000, Zefram wrote:
> Tony Cook wrote:
> >If this what you need?
> 
> Nearly.  Instead of the -d line, please do
> 
>     print stat($cwd) ? join",",stat(_) : $!, "\n";
> 
> and please show the output of Cwd::_backtick_pwd(), not just getcwd().
> For good measure, please do
> 
>     print $_, " ", \&{"Cwd::$_"}, "\n"
> 	foreach qw(cwd getcwd fastgetcwd fastcwd _backtick_pwd _perl_getcwd);

tony@saturn ~/dev/perl/git
$ perl 132648.pl
/home/tony/dev/perl/git/foo
No such file or directory
cwd /home/tony/dev/perl/git/foo
getcwd /home/tony/dev/perl/git/foo
fastgetcwd /home/tony/dev/perl/git/foo
fastcwd /home/tony/dev/perl/git/foo
_backtick_pwd /home/tony/dev/perl/git/foo
.: No such file or directory at 132648.pl line 15.

tony@saturn ~/dev/perl/git
$ cat 132648.pl
#!perl
use Cwd;

mkdir "foo", 0700
  or die "mkdir $!";
chdir "foo"
  or die "chdir $!";
rmdir "../foo"
  or die "rmdir $!";
my $cwd = getcwd
  or die "getcwd $!";
print "$cwd\n";
print stat($cwd) ? join",",stat(_) : $!, "\n";
print $_, " ", &{"Cwd::$_"}, "\n"
  foreach qw(cwd getcwd fastgetcwd fastcwd _backtick_pwd _perl_getcwd);

I assumed you wanted the Cwd::foo functions called rather than a bunch
of CODE(...) output.

Tony

Thread Previous | Thread Next


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