I will start by saying this is largely a learning excersize. I want to
get to the point where I can write a PERL module using some C code in
the backend. I would be greatful as hell for any help on this!
I don't know if this makes enough sense to grok, but here goes:
I want the module to use compiled C to:
1) opendir a directory if readable
2) readdir the dir
3) steps through the files and lstats them
I eventually want to have a PERL module that, given a dir, returns an
array of scalars having the stat data and file name delimited by forward
slashes (since that's the only char I can think of that's not valid in a
unix filename).
Here is why... When I do this in perl, it goes something like:
my @stats;
opendir DIR, $directory;
for (readdir DIR) {
my $file = "$directory/$_";
@stats = lstat($file);
}
closedir(DIR);
As you can see, on line 5 I do an lstat with each iteration of the PERL
loop. I really want to see if extra overhead of doing it from the
indirection of being inside a PERL loop costs me. I think it does
because some of the timings I've done for PERL loops vs ls -F on huge
dirs seem to suggest it.
--
Hob Goblin
[EMAIL PROTECTED]
I filled out an application that said, "In Case Of Emergency
Notify". I wrote "Doctor"... What's my mother going to do?
-- Stephen Wright