NAME

File::Repl - Perl module that provides file replication utilities

SYNOPSIS

use File::Repl;

%con = (
   'dira',      'D:/perl',
   'dirb',      'M:/perl',
   'verbose',   '1',
   );

$ref=File::Repl::SetDefaults(%con);
$ref->Update('\.p(l|m)','a<>b',1);

DESCRIPTION

The File:Repl module provides a simple file replication utility. This allows two directory structures to be maintained.

The Update routine has several arguments. The first argument is a regular expression, used to match all file names that to be maintained. The second argument defines the action to be performed.

a>b

Files in the 'a' directory are to be replicated to the 'b' directory if a replica exists in 'b' directory and the timestamp is older than that of the file in the 'a' directory.

a<b

Files in the 'b' directory are to be replicated to the 'a' directory if a replica exists in 'a' directory and the timestamp is older than that of the file in the 'b' directory.

a<>b

Files in the 'a' directory are to be replicated to the 'b' directory if a replica exists in 'b' directory and the timestamp is older than that of the file in the 'a' directory. Files in the 'b' directory are to be replicated to the 'a' directory if a replica exists in 'a' directory and the timestamp is older than that of the file in the 'b' directory.

A>B

Files in the 'a' directory are to be replicated to the 'b' directory - even if no replica exists in 'b' directory. If a replica already exists in the 'b' directory with a timestamp that is newer than that of the file in the 'a' directory it is not modified.

A>B!

Files in the 'a' directory are to be replicated to the 'b' directory - even if no replica exists in 'b' directory. If a replica already exists in the 'b' directory with a timestamp that is newer than that of the file in the 'a' directory it is not modified. Orphan files in the 'b' directory are deleted.

B

Files in the 'b' directory are to be replicated to the 'a' directory - even if no replica exists in 'a' directory. If a replica already exists in the 'a' directory with a timestamp that is newer than that of the file in the 'b' directory it is not modified.

B!

Files in the 'b' directory are to be replicated to the 'a' directory - even if no replica exists in 'a' directory. If a replica already exists in the 'a' directory with a timestamp that is newer than that of the file in the 'b' directory it is not modified. Orphan files in the 'a' directory are deleted.

B

Files in the 'a' directory are to be replicated to the 'b' directory - even if no replica exists in 'b' directory. If a replica already exists in the 'b' directory with a timestamp that is newer than that of the file in the 'a' directory it is not modified. Files in the 'b' directory are to be replicated to the 'a' directory - even if no replica exists in 'a' directory. If a replica already exists in the 'a' directory with a timestamp that is newer than that of the file in the 'b' directory it is not modified.

The verbose flag has several valid values:

0

No verbosity (default mode)

1

All file copies and deletes are printed.

2

Files identified in each directory that match the regex are printed. SetDefault parameters are also displayed, and the regex and commit parameters printed each time the Update routine is called.

3

Files with identical names in both directories are printed.

AUTHOR

Copyright E<#169> 2000 Dave Roberts, DaveRoberts@iname.com

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.

7 POD Errors

The following errors were encountered while parsing the POD:

Around line 345:

Unterminated A<...> sequence

Deleting unknown formatting code A<>

Around line 352:

Unterminated A<...> sequence

Deleting unknown formatting code A<>

Around line 360:

Deleting unknown formatting code A<>

Around line 381:

Expected text after =item, not a number

Around line 385:

Expected text after =item, not a number

Around line 391:

Expected text after =item, not a number

Around line 400:

Unknown E content in E<#169>