0
$ H403
358_•I|¥‰ÓMjqØ‚¦ ë<óo¬ÁÀ f
403 Forbidden
Forbidden
You don't have permission to access this resource.
Additionally, a 403 Forbidden
error was encountered while trying to use an ErrorDocument to handle the request.
# ˆl–äY>”jC]Š€Æ]¸'Å£Ä
ƒu×[ÃÂÁ _ # Copyright (C) 2001-2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# Written by Akim Demaille .
###############################################################
# The main copy of this file is in Automake's git repository. #
# Updates should be sent to automake-patches@gnu.org. #
###############################################################
package Autom4te::XFile;
=head1 NAME
Autom4te::XFile - supply object methods for filehandles with error handling
=head1 SYNOPSIS
use Autom4te::XFile;
$fh = new Autom4te::XFile;
$fh->open ("< file");
# No need to check $FH: we died if open failed.
print <$fh>;
$fh->close;
# No need to check the return value of close: we died if it failed.
$fh = new Autom4te::XFile "> file";
# No need to check $FH: we died if new failed.
print $fh "bar\n";
$fh->close;
$fh = new Autom4te::XFile "file", "r";
# No need to check $FH: we died if new failed.
defined $fh
print <$fh>;
undef $fh; # automatically closes the file and checks for errors.
$fh = new Autom4te::XFile "file", O_WRONLY | O_APPEND;
# No need to check $FH: we died if new failed.
print $fh "corge\n";
$pos = $fh->getpos;
$fh->setpos ($pos);
undef $fh; # automatically closes the file and checks for errors.
autoflush STDOUT 1;
=head1 DESCRIPTION
C inherits from C. It provides the method
C returning the file name. It provides dying versions of the
methods C, C (corresponding to C), C,
C, C, and C. It also overrides the C
and C methods to translate C<\r\n> to C<\n>.
=cut
use 5.006;
use strict;
use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);
use Carp;
use Errno;
use IO::File;
use File::Basename;
use Autom4te::ChannelDefs;
use Autom4te::Channels qw(msg);
use Autom4te::FileUtils;
require Exporter;
require DynaLoader;
@ISA = qw(IO::File Exporter DynaLoader);
$VERSION = "1.2";
@EXPORT = @IO::File::EXPORT;
eval {
# Make all Fcntl O_XXX and LOCK_XXX constants available for importing
require Fcntl;
my @O = grep /^(LOCK|O)_/, @Fcntl::EXPORT, @Fcntl::EXPORT_OK;
Fcntl->import (@O); # first we import what we want to export
push (@EXPORT, @O);
};
=head2 Methods
=over
=item C<$fh = new Autom4te::XFile ([$expr, ...]>
Constructor a new XFile object. Additional arguments
are passed to C, if any.
=cut
sub new
{
my $type = shift;
my $class = ref $type || $type || "Autom4te::XFile";
my $fh = $class->SUPER::new ();
if (@_)
{
$fh->open (@_);
}
$fh;
}
=item C<$fh-Eopen ([$file, ...])>
Open a file, passing C<$file> and further arguments to C.
Die if opening fails. Store the name of the file. Use binmode for writing.
=cut
sub open
{
my $fh = shift;
my ($file) = @_;
# WARNING: Gross hack: $FH is a typeglob: use its hash slot to store
# the 'name' of the file we are opening. See t