Bric::Util::FTP::FileHandle - Virtual FTP Server FileHandle
$Date: 2002/06/03 21:47:00 $
This module provides a file handle object for use by Bric::Util::FTP::Server.
This module inherits from Net::FTPServer::FileHandle and overrides the required methods. This class is used internally by Bric::Util::FTP::Server.
new($ftps, $template, $oc_id, $category_id)
Creates a new Bric::Util::FTP::FileHandle object. Requires three arguments - the Bric::Util::FTP::Server object, the Bric::Biz::Asset::Formatting object that this filehandle represents (aka the template object), and the category_id which this file is in.
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.
Returns the directory handle for the category that this template is in. Calls Bric::Util::FTP::DirHandle->new().
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.
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.
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.
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.
Sam Tregar (email@example.com)
Hey! The above document had some coding errors, which are explained below:
You can't have =items (as at line 66) unless the first thing after the =over is an =item