develooper Front page | perl.perl5.porters | Postings from July 2000

Change 6429 breaks getcwd() on MachTen

From:
Dominic Dunlop
Date:
July 31, 2000 11:12
Subject:
Change 6429 breaks getcwd() on MachTen
Message ID:
p04320400b5a73bfd2ce3@[194.7.204.14]
The following (coarsely wrapped) is the proximate cause of a test 
failure in lib/findbin.t for perl-current@6450:

$ ./perl -I../lib -MCwd=getcwd -lwe 'print getcwd'
lstat(./../../../../../../../../../../../../../../../../../../../../../../../../
../../../../../../../../../../../../../../../../../../../../../../../../../../..
/../../../../../../../../../../../../../../../../../../../../../../../../../../.
./../../../../../../../../../../../../../../../../../../../../../../../../../../
../../../../../../../../../../../../../../../../../../../../../../../../../../..
/../../../../../../../../../../../../../../../../../../../../../../../../../../.
./../../../../../../../../../../../../../../../../../../../../../../../../../../
../../../../../../../../../../../../../../../../../../../../../../../../../../..
/../../../../../../../../../../../../../../../../../../../../../../../../../../.
./../../../../../../../../../../../../../../../../../../../../../../../../../../
../../../../../../../../../../../../../../../../../../../../../../../../../../..
/../../../../../../../../../../../../../../../../../../../../../../../../../../.
./../../../../../../../../../../../../../../../../../../../MachTen_Folder): No s
uch file or directory at -e line 1

This, in turn is a result of the changes made to Cwd.pm by change 6429.
I have not analysed what's going on, but I'd bet that it's something to
do with MachTen, which is 4.4BSD UNIX hosted by Mac OS, being a "root
in the sky" implementation: the UNIX file hierarchy sits under / (as
one expects), but, (as one wouldn't expect), // is the Mac OS volume
under which MachTen's files live.  To round things off, /.. is
equivalent to / (as one would expect).  This is OK by POSIX, which says
"[a] pathname that begins with two successive slashes may be interpreted
in an implementation-defined manner, although more than two leading
slashes shall be treated as a single slash." 

The clue is that /MachTen_Folder (a standard fixture in MachTen) is a
symlink into a directory under the root in the sky, a directory that
cannot itself be reached by going /.. (the parent of the root directory).

$ ls -l /MachTen_Folder
lrwxr-xr-x  1 root  wheel  9 Jul 27 18:39 /MachTen_Folder -> //MachTen

My guess is that the very long path above is too long for some system
buffer or another, and that it is the truncated name that is "not found",
so precipitating the error message.

My (not disinterested) feeling is that Perl should work with systems
whose idiosyncrasies are permitted by POSIX. Does this analysis make
sufficient sense for you to be able to propose a fix, or would you
prefer me to have a hack at the problem?
-- 
Dominic Dunlop



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