|
Net::FileShare - Object oriented interface for the creation of file sharing clients and servers. |
Net::FileShare - Object oriented interface for the creation of file sharing clients and servers.
## 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");
Net::FileShare provides an object interface for creating file sharing servers and clients.
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()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()client_automated()client_interactive()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 2003, Gene Gallistel. All rights reserved.
This program is free software. You may copy or redistribute it under the same terms as Perl itself.
Gene Gallistel, gravalo@uwm.edu, http://www.uwm.edu/~gravalo
|
Net::FileShare - Object oriented interface for the creation of file sharing clients and servers. |