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

- NAME
- SYNOPSIS
- DESCRIPTION
- AUTHOR

# 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.

A<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.

A<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:

1. No verbosity (default mode)

2. All file copies and deletes are printed.

3. 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.

4. Files with identical names in both directories are printed.

# AUTHOR

Copyright © 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.