NAME
Sendmail::Queue::Df - Represent a Sendmail dfXXXXXX (data) file
SYNOPSIS
use Sendmail::Queue::Df
# Create a new df file object
my $df = Sendmail::Queue::Df->new();
# Give it an ID
$df->set_queue_id( $some_qf->get_queue_id );
# Give it some data directly
$df->set_data( $scalar_with_body );
# ... or, give some data from a filehandle
$df->set_data_from( $some_fh );
# ... or, hardlink it to another object, or to a pathname
$df->hardlink_to( $other_df );
$df->hardlink_to( '/path/to/file' );
# Make sure it's on disk.
$df->write( '/path/to/queue');
DESCRIPTION
Sendmail::Queue::Df provides a representation of a Sendmail df (data) file.
METHODS
new ( \%args )
Create a new Sendmail::Queue::Df object.
hardlink_to ( $target )
Instead of writing a new data file, hardlink this one to an existing file.
$target can be either a Sendmail::Queue::Df object, or a scalar pathname.
get_data_filename
Return the full path name of this data file.
Will return undef if no queue ID exists, and die if queue directory is unset.
set_data_from ( $data_fh )
Given a filehandle, read the data from it, up to the end of file, and store it in the object.
write ( )
Write data to df file, if necessary.
unlink ( )
Unlink the queue file. Returns true (1) on success, false (undef) on failure.
Unlinking the queue file will only succeed if we have a queue directory and queue ID configured for this object. Otherwise, we fail to delete.
DEPENDENCIES
Core Perl Modules
Carp, Scalar::Util, File::Spec, IO::File, Fcntl
INCOMPATIBILITIES
There are no known incompatibilities with this module.
BUGS AND LIMITATIONS
There are no known bugs in this module. Please report problems to the author. Patches are welcome.
AUTHOR
Dave O'Neill, <support at roaringpenguin.com>
LICENCE AND COPYRIGHT
Copyright (c) 2007 Roaring Penguin Software, Inc. All rights reserved.