Closed p5pRT closed 11 years ago
The POSIX::readdir call isn't POSIX compliant.
It doesn't return the minimal data items required by posix.
The library readir page says: Only the fields d_name and d_ino are specified in POSIX.1-2001. The remaining fields are available on many\, but not all systems.
Neither perl's POSIX nor it's builtin return the inode number\, making it impossible to names to a array of inodes without doing per-file lookups which require opening each inode for the additional information returned (as in a stat call).
Doing that a couple of million times adds a huge amount of per-file latency in looking up inode information -- especially when some file systems allow dumping all inodes in bulk in 1 system call.
On Wed\, Oct 31\, 2012 at 12:50 AM\, Linda Walsh \perlbug\-followup@​perl\.org wrote:
The POSIX::readdir call isn't POSIX compliant.
It doesn't return the minimal data items required by posix.
The library readir page says: Only the fields d_name and d_ino are specified in POSIX.1-2001. The remaining fields are available on many\, but not all systems.
Neither perl's POSIX nor it's builtin return the inode number\, making it impossible to names to a array of inodes without doing per-file lookups which require opening each inode for the additional information returned (as in a stat call).
Doing that a couple of million times adds a huge amount of per-file latency in looking up inode information -- especially when some file systems allow dumping all inodes in bulk in 1 system call.
d_ino is part of the XSI extensions\, which means it's not only not strictly required (though that's a bad excuse)\, but also that its standardization probably younger than POSIX.pm (I wish archeology for such things was as easier so I could be sure). It's also not very portable. I would recommend solving this issue on CPAN.
Leon
The RT System itself - Status changed from 'new' to 'open'
On Tue Oct 30 16:50:51 2012\, LAWalsh wrote:
This is a bug report for perl from perl-diddler@tlinx.org\, generated with the help of perlbug 1.39 running under perl 5.16.1.
----------------------------------------------------------------- [Please describe your issue here]
The POSIX::readdir call isn't POSIX compliant.
We don't make any claim that the POSIX module is "POSIX compliant."
What 'perldoc POSIX' does say in its DESCRIPTION is:
"The POSIX module permits you to access all (or nearly all) the standard POSIX 1003.1 identifiers. Many of these identifiers have been given Perl-ish interfaces."
It doesn't return the minimal data items required by posix.
The POSIX readdir function returns a struct\, which\, by definition\, is not a Perl-ish interface.
Neither perl's POSIX nor it's builtin return the inode number\, making it impossible to names to a array of inodes without doing per-file lookups which require opening each inode for the additional information returned (as in a stat call).
Perhaps\, as another poster has suggested\, you should contribute something to CPAN to solve this problem.
As there's no real bug here\, I recommend this ticket be closed.
Thank you very much. Jim Keenan
* James E Keenan via RT (perlbug-followup@perl.org) [121102 16:24]:
Perhaps\, as another poster has suggested\, you should contribute something to CPAN to solve this problem.
POSIX::1003 welcomes such contributions. -- MarkOv
Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
On Fri Nov 02 12:23:05 2012\, Mark@Overmeer.net wrote:
* James E Keenan via RT (perlbug-followup@perl.org) [121102 16:24]:
Perhaps\, as another poster has suggested\, you should contribute something to CPAN to solve this problem.
POSIX::1003 welcomes such contributions.
Closing ticket\, as there's a better course of action open on CPAN.
Thank you very much. Jim Keenan
@jkeenan - Status changed from 'open' to 'rejected'
Migrated from rt.perl.org#115532 (status was 'rejected')
Searchable as RT115532$