delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/02/26/23:14:25

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: "Rick Rankin" <rrankin AT primenet DOT com>
To: "Todd Goodman" <tsg1 AT earthlink DOT net>,
"'Sebastien Barre'" <Sebastien DOT Barre AT utc DOT fr>
Cc: <cygwin AT sourceware DOT cygnus DOT com>
Subject: RE: (C<readdir> broken ?) pb with Cwd::getcwd() ! [perl 5.005_02 / Cygwin32 B.20.1]
Date: Fri, 26 Feb 1999 21:12:53 -0700
Message-ID: <NCBBLBLBNJPLCPKCBIIIOEPGCBAA.rrankin@primenet.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2212 (4.71.2419.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800
In-Reply-To: <001e01be61fd$138424c0$0301a8c0@tgoodman8>
Importance: Normal

The code in Cwd.pm, specifically in abs_path, is based on the fact that
under Unix, when you stat '.', then cd .., then stat the name of the
directory you just came from, you get the same inode number. That apparently
doesn't happen under Cygwin. Because of that, a loop in abs_path doesn't
terminate properly, and abs_path fails. Todd's fix works, and I have a
little different one that looks like this:

--- CUT HERE ---
*** Cwd.pm      Fri Feb 26 21:09:26 1999
--- Cwd.pm.save Fri Feb 26 21:09:06 1999
***************
*** 371,384 ****
          *abs_path     = \&_qnx_abs_path;
          *fast_abs_path        = \&_qnx_abs_path;
      }
-     elsif ($^O =~ /cygwin/) {
-               *cwd            = \&_backtick_pwd;
-               *getcwd         = \&_backtick_pwd;
-               *fastgetcwd     = \&_backtick_pwd;
-               *fastcwd        = \&_backtick_pwd;
-               *abs_path       = \&_backtick_pwd;
-               *fast_abs_path  = \&_backtick_pwd;
-       }
  }

  # package main; eval join('',<DATA>) || die $@;       # quick test
--- CUT HERE ---

Rick
--
Rick Rankin
rrankin AT primenet DOT com

> -----Original Message-----
> From: cygwin-owner AT sourceware DOT cygnus DOT com
> [mailto:cygwin-owner AT sourceware DOT cygnus DOT com]On Behalf Of Todd Goodman
> Sent: Friday, February 26, 1999 7:59 PM
> To: 'Sebastien Barre'
> Cc: cygwin AT sourceware DOT cygnus DOT com
> Subject: RE: (C<readdir> broken ?) pb with Cwd::getcwd() ! [perl
> 5.005_02 / Cygwin32 B.20.1]
>
>
> I don't have any problem with readdir and getcwd from my
> perl source directory works fine:
>
> /usr/local/src/perl5.005_02> perl -e 'use Cwd; print getcwd() . "\n";'
> /usr/local/src/perl5.005_02
> /usr/local/src/perl5.005_02>
>
> Did you patch Cwd.pm as in the different instructions for
> building Perl?
>
> This is my change in Cwd.pm:
>
> --- cwd.pm	Fri Feb 26 21:52:42 1999
> +++ cwd.pm.orig	Fri Jan 22 20:49:54 1999
> @@ -208,8 +208,6 @@
>      my $start = @_ ? shift : '.';
>      my($dotdots, $cwd, @pst, @cst, $dir, @tst);
>
> -    return cwd() if ( $^O =~ /cygwin/ );
> -
>      unless (@cst = stat( $start ))
>      {
>  	carp "stat($start): $!";
>
> > -----Original Message-----
> > From: Sebastien Barre [mailto:Sebastien DOT Barre AT utc DOT fr]
> > Sent: Friday, February 26, 1999 1:56 AM
> > To: Todd Goodman
> > Cc: cygwin AT sourceware DOT cygnus DOT com
> > Subject: RE: (C<readdir> broken ?) pb with Cwd::getcwd() ! [perl
> > 5.005_02 / Cygwin32 B.20.1]
> >
> >
> > At 23:04 25/02/99 -0500, Todd Goodman wrote:
> >
> > >I don't quite understand what you're saying below, but I believe the
> > >problem you're seeing is because the runpod2man subroutine
> > in installman
> >
> > No, it does not seem to be a Perl pb : the Perl getcwd() command (see
> > Cwd.pm) just seems not to work, and seems related to
> > readdir() : is there a
> > known bug with readdir() ?
> >
> > >> Use ::Cwd;
> > >> print getcwd();
> >
> > By the way, there is a typo, that was :
> >
> > >> Use Cwd;
> > >> print getcwd();
> >
> >
> > ______________________________________________________________
> > Sebastien Barre                  http://www.hds.utc.fr/~barre/
> >
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
>


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019