The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

POE::Component::Client::SimpleFTP::Utils - Miscellaneous FTP utility functions

VERSION

  This document describes v0.004 of POE::Component::Client::SimpleFTP::Utils - released November 04, 2014 as part of POE-Component-Client-SimpleFTP.

SYNOPSIS

        use POE::Component::Client::SimpleFTP::Utils qw( :code );

        # in an event handler
        my $code = shift;
        if ( code_success( $code ) ) {
                print "FTP command OK\n";
        } else {
                warn "FTP command error!";
        }

DESCRIPTION

This module provides the various utility functions for use in your FTP application. You can import any sub listed in the POD or those tags:

code

Imports all of the code_* subs

FUNCTIONS

code_preliminary

Tests whether the code is a 1yz code ( Positive Preliminary reply ) and returns a boolean value.

code_success

Tests whether the code is a 2yz code ( Positive Completion reply ) and returns a boolean value.

code_intermediate

Tests whether the code is a 3yz code ( Positive Intermediate reply ) and returns a boolean value.

code_failure

Tests whether the code is a 4yz or 5yz code ( Transient/Permanent Negative Completion reply ) and returns a boolean value.

code_tls

Tests whether the code is a 6yz code ( Protected reply ) and returns a boolean value.

EOL

Returns the end-of-line terminator as specified in RFC 959

mdtm_parser

Returns a DateTime object representing the modification timestamp of a file. Useful for parsing "mdtm" in POE::Component::Client::SimpleFTP replies!

NOTE: The MDTM format does not supply a timezone, you have to process that yourself!

On an error returns undef.

feat_parser

Returns an array of FEAT capabilities present on the server. Useful for parsing "feat" in POE::Component::Client::SimpleFTP replies!

On an error returns an empty array.

SEE ALSO

Please see those modules/websites for more information related to this module.

AUTHOR

Apocalypse <APOCAL@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Apocalypse.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

The full text of the license can be found in the LICENSE file included with this distribution.

DISCLAIMER OF WARRANTY

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.