SPUG: getpwent bug in find2perl
Tim Maher
tim at consultix-inc.com
Sat Aug 13 20:16:24 PDT 2005
On Sat, Aug 13, 2005 at 07:33:26PM -0700, DeRykus, Charles E wrote:
>
> > Consider this situation:
>
> > unix$ find2perl . -ls > find_ls.pl # Using latest File::Find v1.09
>
> > <Later, somewhere in Redmond>
>
> > C> find_ls.pl
> > The getpwent function is unimplemented at -e line 1.
> >
> > I understand that getpwent() is a native Unix library
> > function, and that Windoze doesn't even have the passwd-file
> > entries alluded to by the PW/ent part of the name, but I
> > don't understand why find2perl blithely composes a script
> > that depends on this function, when find2perl itself is
> > principally used to let Windoze people pretend to have a find
> > command (AFAIK).
> > Anybody have any fixes for this (e.g,. use POSIX_something), or other
> > insights?
>
> Were you hoping to get an emulation of 'ls -l' or would a simple 'ls'
> suffice:
>
> perl -MFile::Find -le "find sub{print},'.'" # Win32
>
> Charles DeRykus
Wow! That command's pretty inscrutable, but I get it.
Actually, I really don't have any pressing need to do file listings of /any/
kind on Windoze, but in my book I'm discussing the use of find2perl
by Unix users to compose scripts for Jr. SAs to run on Windoze,
and I was just surprised to find that one of the most common uses
of find, "find . -ls", doesn't even run successfully on Windoze.
Don't you think it should? If not, then maybe we need a portability
option to find2perl, to make sure it disallows the use of "-ls" with
that option, or else implements it portably.
-Tim
*--------------------------------------------------------------------------*
| Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX |
| tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com |
*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*
| Watch for my Fall, 2005 book: "Minimal Perl for UNIX/Linux People" |
| See http://minimalperl.com for details, ordering, and email-list signup |
*--------------------------------------------------------------------------*
More information about the spug-list
mailing list