New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IO::File reads garbage from directory filehandles #7514
Comments
From alester@flr.follett.comCreated by alester@flr.follett.comI'm able to open a directory with IO::File->new, and when I do, I I don't WANT to be able to read from the filehandle, but it seems it alester@dinger[~]$ cat iofile.pl use strict; my $filename = shift || "/home/alester"; alester@dinger[ Perl Info
|
From @smpetersThe decision of whether a directory can be accessed as a file is very I experimented on Linux with the script and simply "cat /tmp" to check <snip> My experience from Solaris and HP-UX (and other UNIXs) is that this Now, I guess the question is whether we want IO::File's behavior |
The RT System itself - Status changed from 'new' to 'open' |
From ajs@ajs.comOn Mon, 2004-09-27 at 12:12, Steve Peters via RT wrote:
Yes, you are correct. Historically, this is because directories used to
Absolutely yes. It's one of those situations where I think the best -- |
From perl5-porters@ton.iguana.beIn article <1096310497.1249.53.camel@pps>,
I agree with you, but it still might be nice to have an option/flag that |
From @TuxOn Mon 27 Sep 2004 20:41, Aaron Sherman <ajs@ajs.com> wrote:
--8<--- xx.c int main (int argc, char *argv[]) HP-UX 11.11 (11i) HP-UX 11.00 HP-UX 10.20 AIX 5.2.0 AIX 4.3.3 SuSE 9.1 Linux 2.6.5-7.108-default CYGWIN_NT-5.0 1.5.11(0.116/4/2) M$ Visual C++ C:\Tmp> -- FWIW same message if I open "." or "\\Tmp" -- |
From nick@ing-simmons.netH.Merijn Brand <h.m.brand@hccnet.nl> writes:
So all the Unix-oids (including cygwin!) let you open() a directory. Win32 doesn't let you - no real surprise. |
From nick@ing-simmons.netAaron Sherman <ajs@ajs.com> writes:
And it seems that on Linux opendir() may still do an open(), |
From @smpeters
OK, at least it seems that we're in agreement that this behavior is Two points brought up remain, though. * Do we want to add an optional argument to IO::File->new() so that it * Do we want to document this behavior? Those who have bounced around |
From @rgsSteve Peters via RT wrote:
Yep.
I don't see how the current interface could be extended in a consistent,
Maybe a caveat in IO::File. I'd say that this doesn't deserve a FAQ entry :) -- |
From @petdanceOn Thu, Sep 30, 2004 at 01:26:09PM -0000, Steve Peters via RT (perlbug-followup@perl.org) wrote:
Just a note in the docs should be fine, I would think. We need to say xoxo, -- |
From nick@ing-simmons.netAndy Lester <andy@petdance.com> writes:
An alternative might be to fake open() to work on directories on Win32 ;-)
|
From nick@ing-simmons.netSteve Peters via RT <perlbug-followup@perl.org> writes:
Personally I see no reason to use IO::File ever again so I don't care I see some minor merit in mentioning amongst all the other |
From @smpeters
Below is a patch to explain the behavior and to suggest better alternatives. --- /usr/libdata/perl5/i386-openbsd/5.8.5/IO/File.pm Fri Sep 17 =back +=head1 NOTE L<perlfunc>, =head1 HISTORY @@ -121,7 +129,7 @@ @ISA = qw(IO::Handle IO::Seekable Exporter); -$VERSION = "1.10"; @EXPORT = @IO::Seekable::EXPORT; |
From @smpeters
Scratch the previous patch as I noticed a grammatical error right after --- /usr/libdata/perl5/i386-openbsd/5.8.5/IO/File.pm Fri Sep 17 =back +=head1 NOTE L<perlfunc>, =head1 HISTORY @@ -121,7 +129,7 @@ @ISA = qw(IO::Handle IO::Seekable Exporter); -$VERSION = "1.10"; @EXPORT = @IO::Seekable::EXPORT; |
From @petdanceOn Sat, Nov 27, 2004 at 03:36:48PM -0000, Steve Peters via RT (perlbug-followup@perl.org) wrote:
Let's ditch the passive voice and be more definitive. Some operatings systems may perform a C<IO::File::new> or Thanks for digging this up again. xoa -- |
From @smpetersOn Sat, Nov 27, 2004 at 10:55:39AM -0600, Andy Lester wrote:
Better still, let's mention directories earlier... Some operatings systems may perform a C<IO::File::new> or Steve Peters |
From @ysthOn Sat, Nov 27, 2004 at 11:20:28AM -0600, steve@fisharerojo.org wrote:
But that's not correct; I thought some allowed opening directories but |
From @smpeters
OK, the passive voice has ben removed, vague results restored, and IO::Dir suggested |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#31730 (status was 'resolved')
Searchable as RT31730$
The text was updated successfully, but these errors were encountered: