NAME

Bric::Util::FTP::FileHandle - Virtual FTP Server FileHandle

VERSION

$Revision $

DATE

$Date: 2002/06/03 21:47:00 $

DESCRIPTION

This module provides a file handle object for use by Bric::Util::FTP::Server.

INTERFACE

This module inherits from Net::FTPServer::FileHandle and overrides the required methods. This class is used internally by Bric::Util::FTP::Server.

Constructors

Public Instance Methods

open($mode)

This method opens this template object for access using the provided mode ('r', 'w' or 'a'). The method returns an IO::Scalar object that will be used by Net::FTPServer to access the template text. For read-only access a plain IO::Scalar object is returned. For write-methods an internal tied class - Bric::Util::FTP::FileHandle::SCALAR - is used with IO::Scalar to provide write-access to the data in the database. Returns undef on failure.

dir()

Returns the directory handle for the category that this template is in. Calls Bric::Util::FTP::DirHandle->new().

status()

This method returns information about the object. The return value is a list with seven elements - ($mode, $perms, $nlink, $user, $group, $size, $time). To quote the good book (Net::FTPServer::Handle):

$mode     Mode        'd' = directory,
                      'f' = file,
                      and others as with
                      the find(1) -type option.
$perms    Permissions Permissions in normal octal numeric format.
$nlink    Link count
$user     Username    In printable format.
$group    Group name  In printable format.
$size     Size        File size in bytes.
$time     Time        Time (usually mtime) in Unix time_t format.

$mode is always 'f'. $perms is set depending on wether the template is checked out and whether the user has access to edit the template. $nlink is always 1. $user is set to the user that has the template checked out or "nobody" for checked in templates. $group is "ci" if the template is checked out, "ci" if it's checked in. $size is the size of the template text in bytes. $time is set to the deploy_time() of the template.

delete()

Deletes the current template. This has the same effect as deleting the template through the UI - it undeploys the template if it's deployed and marks it inactive.

can_*()

Returns permissions information for various activites. can_read() always returns 1 since templates can always be read. can_rename() and can_delete() return 0 since these operations are not yet supported. can_write() and can_append() return 1 if the user can write to the template - if it's checked in and the user has permission.

PRIVATE

Private Classes

Bric::Util::FTP::FileHandle::SCALAR

This class provides a tied scalar interface to a template object's data. The TIESCALAR constructor takes a template object as a single argument. Writes to the tied scalar result in the template object being altered, saved, checked-in and deployed.

AUTHOR

Sam Tregar (stregar@about-inc.com)

SEE ALSO

Net:FTPServer::FileHandle

Bric::Util::FTP::Server

Bric::Util::FTP::DirHandle

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 35:

You can't have =items (as at line 66) unless the first thing after the =over is an =item