Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ropkg::rsync::conffile(3pm) [debian man page]

RoPkg::Rsync::ConfFile(3pm)				User Contributed Perl Documentation			       RoPkg::Rsync::ConfFile(3pm)

NAME
RoPkg::Rsync::ConfFile DESCRIPTION
RoPkg::Rsync::ConfFile is a class used to manipulate rsync configuration files. Is capable to maintaine the order of the modules, and even keep your comments and empty lines intact. SYNOPSIS
#!/usr/bin/perl use warnings; use strict; sub main { my $cf = new RoPkg::Rsync::ConfFile(filename => '/etc/rsyncd.conf'); $cf->Write('/tmp/new_rsyncd.conf'); return 0; } main(); METHODS
All methods, throw the OutsideClass exception, if you use them as class methods. Besides OutsideClass the methods are throwing other exceptions as well. Refer to each method documentation for more information. new(%hash) The class constructor. Accepts a hash as parameter. At this moment only one parameter can be specified inside the hash: filename . If this parameter is present, the file specified is parsed and loaded into the object. AddParam($pname, $pvalue) Add a new global parameter named $pname with value $value. AddComment($pval) Add a new global comment with value $pval AddBlank($bval) Add a new global blank line with value $bval AddNode($node) Adds a new RoPkg::Rsync::Node object to the current object. Before the node is added, the nodes list is checked for duplicates of the object. If a duplicate is found, the method does nothing. Exceptions: If $node is not a instance of RoPkg::Rsync::Node, Param::Wrong exception is raised. DelNode($node_name) Removes a node from the nodes list. The nodes are searched by their names. Returns -1 if the node was not found, the new number of nodes otherwise. HasNode($node_name) Returns 1 if the node with name $node_name was found in the nodes list, 0 otherwise. Clean() Clean the object. Removes all information (the nodes list, statistics, etc). Always returns 1. Parse($filename) Parse the configuration file $filename and returns the number of nodes. If $filename is not defined Param::Missing exception is raised. If the path does not point to a existing file, File::NotFound exception is raised. If the file could not be opened, File::Open exception is raised. Write($path) Write the configuration into the file specified by path $path. ToString() Returns the string representation of the configuration file. PREREQUISITES
perl 5.008 (or later) is required. Besides perl, you must have the following: *) RoPkg::Exceptions *) Scalar::Util *) English SEE ALSO
RoPkg::Rsync::Atom RoPkg::Rsync::ConfFile RoPkg::Exceptions AUTHOR
Subredu Manuel <diablo@iasi.roedu.net> LICENSE
Copyright (C) 2005 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license. perl v5.8.8 2006-06-09 RoPkg::Rsync::ConfFile(3pm)

Check Out this Related Man Page

RoPkg::Simba::Mirror(3pm)				User Contributed Perl Documentation				 RoPkg::Simba::Mirror(3pm)

NAME
RoPkg::Simba::Mirror - a mirror class VERSION
0.1.3 DESCRIPTION
RoPkg::Simba::Mirror is a class used to hold all the information a mirror has. Also, the RoPkg::Simba::Mirror can be used to add/del/update a mirror to/from the database. Simba is derivated from RoPkg::DBObject. SYNOPSIS
!#/usr/bin/perl use RoPkg::DB; use RoPkg::Simba::Mirror; sub main { my $dbp = new RoPkg::DB(); $dbp->Add('dbi:mysql:database=mysql;host=localhost', 'root', '', 'local'); my $m = new RoPkg::Simba::Mirror(dbo => $dbp, dbo_method => 'db_local'); $m->Name('debian'); $m->Load(); } main(); SUBROUTINES
/METHODS All methods raise OutsideClass exception when called outside class instance. Besides this, each method, may raise other exceptions. Check each method section to find out more. new() The class constructor. At this moment, it just calls RoPkg::DBObject->new() . Please read the RoPkg::DBObject manual page for more information about the new() parameters. table() Returns the name of the mirrors database table. Add() Adds the mirror to the database. This method is a wrapper for RoPkg::DBObject::SQL_Insert . On success 0 is returned. On error, DBI exception is raised. Delete() Deletes the current mirror from the database. Before calling this method, you should set the id of the mirror . If you don't set the id Param::Missing exception is raised. On database operation success, 0 is returned. On database error, DBI exception is raised. Update() Update the current mirror object with the database. Before calling this method, you should set the id of the mirror . If you don't set the id Param::Missing exception is raised. On database operation success, 0 is returned. On database error, DBI exception is raised. Load() Load the mirror information from the database, into the current object. Before calling this method you should have set id or Name. If id or Name are not set, then Param::Missing is raised. On database operation success 0 is returned. On database error, DBI exception is raised. GetMethods() Returns a array with the current object methods names. In scalar context returns the number of methods. The following methods are get/set methods for all fields of a mirror. *) id *) Name *) Description *) HomeSite *) LocalDir *) Size *) SyncMethod *) CommandID *) LastErrorCode *) Active *) InProgress *) SyncSource *) SyncSourceUser *) SyncSourcePass *) SyncSourceModule *) Contact *) LastUpdated *) LastUpdateDuration *) LastUpdateSpeed *) LastUpdateFilesNo *) LastUpdateBytes *) LocalURL *) StdOut *) StdErr DIAGNOSTICS
Unpack the source, and use 'make test' command CONFIGURATION AND ENVIRONMENT
This module does not use any configuration files or environment variables DEPENDENCIES
RoPkg::DBObject and RoPkg::Exceptions INCOMPATIBILITIES
None known to the author BUGS AND LIMITATIONS
None known to the author PERL CRITIC
This module is perl critic level 2 compliant (with 1 exception) SEE ALSO
RoPkg::Simba RoPkg::Simba::Mirrors RoPkg::DBObject RoPkg::Object AUTHOR
Subredu Manuel <diablo@iasi.roedu.net> LICENSE AND COPYRIGHT
Copyright (C) 2005 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license. perl v5.14.2 2006-07-04 RoPkg::Simba::Mirror(3pm)
Man Page