New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FindBin fails if all directories in cwd are not readable #909
Comments
From mneme@io.comPossible solutions:
-- |
From @schwern
I am unable to replicate this behavior on OS X using 5.4.5 or 5.5.4. As Can you tell us what operating system you were using, and version of |
The RT System itself - Status changed from 'stalled' to 'open' |
@schwern - Status changed from 'open' to 'stalled' |
From @rgarciaOn 7/13/05, Michael G Schwern via RT <perlbug-followup@perl.org> wrote:
IIUC that was probably fixed by change #24375 or by further changes.
|
The RT System itself - Status changed from 'stalled' to 'open' |
From mneme@io.comRafael Garcia-Suarez via RT writes:
Seems to have been. I can't replicate it on FreeBSD 4.11/perl 5.8.6 OTOH, I -was- able to replicate it on Solaris (SunOS 5.8) with perl The test program was: ======================================== use FindBin; print "Hi there. I am at: $FindBin::Bin\n";When running inside an unreadable directory, it worked fine. When running inside a directory whose -parent- was unreadable, I got: opendir(./..): Permission denied at FWIW, FindBin.pm:143 is: -- |
From @schwernOn Wed, Jul 13, 2005 at 09:58:44AM -0500, Joshua Kronengold wrote:
I can replicate on OS X with several versions of perl. 0 ~/tmp/foo/bar$ ls ~/tmp/foo 0 ~/tmp/foo/bar$ bleadperl -MFindBin -wle 'print "$FindBin::Bin"' 0 ~/tmp/foo/bar$ perl5.4.5 -MFindBin -wle 'print "$FindBin::Bin"' 0 ~/tmp/foo/bar$ perl5.5.4 -MFindBin -wle 'print "$FindBin::Bin"' 0 ~/tmp/foo/bar$ perl5.8.6 -MFindBin -wle 'print "$FindBin::Bin"' 0 ~/tmp/foo/bar$ perl5.8.1 -MFindBin -wle 'print "$FindBin::Bin"' The bleadperl version tries both getcwd() and cwd(). Both fail. $ perl -MCwd -wle 'for (@ARGV) { print eval "Cwd::$_()" }' cwd getcwd fastcwd fastgetcwd abs_path fast_abs_path realpath fast_realpath Use of uninitialized value in print at -e line 1. Use of uninitialized value in print at -e line 1. pwd: : Permission denied Use of uninitialized value in print at -e line 1. Use of uninitialized value in pattern match (m//) at /sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/Cwd.pm line 566. Use of uninitialized value in print at -e line 1. Use of uninitialized value in pattern match (m//) at /sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/Cwd.pm line 566. I don't know if this can be fixed as the only reliable method at this -- |
From mneme@io.comOn Wed, 13 Jul 2005 7:17 pm, Michael G Schwern via RT wrote:
I think shelling out usually works (on unixlike systems) as a last |
From @schwernOn Wed, Jul 13, 2005 at 07:43:13PM -0400, Joshua Kronengold wrote:
One of the things Cwd tries is `pwd`. It doesn't work because it doesn't 0 ~/tmp/foo/bar$ perl -wle 'print `pwd`' -- |
From mneme@io.comOn Thu, 14 Jul 2005 6:37 am, Michael G Schwern wrote:
Wow. |
From @schwernOn Thu, Jul 14, 2005 at 07:11:41AM -0400, Joshua Kronengold wrote:
Oh, I was using an unreadable and unexecutable parent directory. If I try it with 0711... 0 ~/tmp/foo/bar$ sudo chmod 711 ../../foo 0 ~/tmp/foo/bar$ perl -MFindBin -wle 'print $FindBin::Bin' 0 ~/tmp/foo/bar$ perl -wle 'print `pwd`' 0 ~/tmp/foo/bar$ pwd That last one works because its the shell's internal pwd using $PWD. -- |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#1844 (status was 'resolved')
Searchable as RT1844$
The text was updated successfully, but these errors were encountered: