The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::FileShare - Object oriented interface for the creation of file sharing clients and servers.

EXAMPLES

        ## example file sharing server
        #!/usr/bin/perl -w
        use strict;
        use Net::FileShare;
        my ($fh) = Net::FileShare->new(
                        _send_only => 1,
                        _directory => '/path/to/files/to/serve', ## avoid using a trailing / on path
                        _debug     => 1);
        $fh->server_connection;

        ## example interactive client
        #!/usr/bin/perl -w
        use strict;
        use Net::FileShare;
        my ($fh) = Net::FileShare->new(
                        _send_only => 0,
                        _directory => '/home/usr_id', ## avoid using a trailing / here as well
                        _debug     => 1);
        $fh->client_interactive("x.x.x.x","port");

        ## example of automated client
        #!/usr/bin/perl -w
        use strict;
        use Net::FileShare;
        my ($fh) = Net::FileShare->new(
                        _directory => '/home/usr_id'  ## again...avoid trailing /
                                      );
        $fh->client_automated("x.x.x.x","port","get","some_file");

SYNOPSIS

Net::FileShare provides an object interface for creating file sharing servers and clients.

DESCRIPTION

This distribution represents a complete rewrite of the Net::FileShare code base. Every aspect has been rewritten to improve upon methodology. If you're currently running the 1.X code base its serously suggested that you download this new 0.1X code and install. See the changes file contained within this distribution for the specifics on how the Net::FileShare code has been changed/improved in the 0.1X distribution.

new()

The Net::FileShare new() method creates an object, which can then be used to construct either a server or client. There are three has values which can be used to construct the object. They are as follows: _send_only (1 for on, 0 for off), _directory (path to files to share or download directory), and _debug (1 for on, 0 for off). For the construction of servers, _send_only and _directory are required values to set. Clients are only required to supply the _directory value. Note: avoid the use of a trailing slash when listing your path for the _directory option: /home/my_login_name ## good /home/my_login_name/ ## bad The next version of this code will fix this problem.

server_connection()

The server_connection sub impliments a forking filesharing server. Its first action is to establish a socket, then begin the process of accepting clients. Once a client connection is accepted, the connection is forked. If this is successful the server then initiates the handle_request sub, which interfaces with client.

client_automated()

This is an automated version of the interactive client session. It is a run once session. The user must supply either three or four parameters here. They are IP of server, port of server, command (either list or get), and an optional file name (if command = get). See EXAMPLES above.

client_interactive()

This is the interactive client connection. It begins with a client connection to a server running the Net::FileShare module. Once the client connection has been established, the client process will be forked. Once this occurs, the client the begins and interactive session where it can request either a list of files the server is offering, or a specific file. The user must supply two variables here. Those are the IP of server and port of server. See EXAMPLES above.

COPYRIGHT

Copyright 2003, Gene Gallistel. All rights reserved.

This program is free software. You may copy or redistribute it under the same terms as Perl itself.

AUTHOR

Gene Gallistel, gravalo@uwm.edu, http://www.uwm.edu/~gravalo

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 702:

'=item' outside of any '=over'

Around line 725:

You forgot a '=back' before '=head1'