Net-LibNFS
view release on metacpan or search on metacpan
lib/Net/LibNFS.pm view on Meta::CPAN
=head2 $nfs_fh = I<OBJ>->open( $PATH, $FLAGS [, $MODE] )
Opens a file and returns a L<Net::LibNFS::Filehandle> instance to
interact with it.
=head2 $obj = I<OBJ>->mkdir( $PATH [, $MODE] )
Creates a directory.
Returns I<OBJ>.
=head2 $obj = I<OBJ>->rmdir( $PATH )
Deletes a directory.
Returns I<OBJ>.
=head2 $obj = I<OBJ>->chdir( $PATH )
Changes I<OBJ>âs directory.
Returns I<OBJ>.
=head2 $obj = I<OBJ>->mknod( $PATH, $MODE, $DEV )
Like L<mknod(2)>.
Returns I<OBJ>.
=head2 $obj = I<OBJ>->unlink( $PATH )
Deletes a file.
Returns I<OBJ>.
=head2 $nfs_dh = I<OBJ>->opendir( $PATH )
Opens a directory and returns a L<Net::LibNFS::Dirhandle> instance to
read from it.
=head2 $statvfs_obj = I<OBJ>->statvfs( $PATH )
Like L<statvfs(2)>. Returns a L<Net::LibNFS::StatVFS> instance.
=head2 $destination = I<OBJ>->readlink( $PATH )
Reads a symlink directly.
=head2 $obj = I<OBJ>->chmod( $PATH, $MODE )
Sets a pathâs mode.
Returns I<OBJ>.
=head2 $obj = I<OBJ>->lchmod( $PATH, $MODE )
Like C<chmod()> above but wonât follow symbolic links.
Returns I<OBJ>.
=head2 $obj = I<OBJ>->chown( $PATH, $UID, $GID )
Sets a pathâs ownership.
Returns I<OBJ>.
=head2 $obj = I<OBJ>->utime( $PATH, $ATIME, $MTIME )
Updates $PATHâs atime & mtime. A time can be specified as either:
=over
=item * A nonnegative number (not necessarily an integer).
=item * A reference to a 2-member array of nonnegative integers:
seconds and microseconds.
=back
Returns I<OBJ>.
=head2 $obj = I<OBJ>->lutime( $PATH, $ATIME, $MTIME )
Like C<utime()> above but can operate on symlinks.
Returns I<OBJ>.
=head2 $obj = I<OBJ>->lchown( $PATH, $MODE )
Like C<chown()> above but wonât follow symbolic links.
Returns I<OBJ>.
=head2 $obj = I<OBJ>->link( $OLDPATH, $NEWPATH )
Creates a hard link.
Returns I<OBJ>.
=head2 $obj = I<OBJ>->symlink( $OLDPATH, $NEWPATH )
Creates a symbolic link.
Returns I<OBJ>.
=head2 $obj = I<OBJ>->rename( $OLDPATH, $NEWPATH )
Renames a filesystem path.
Returns I<OBJ>.
=head1 UNIMPLEMENTED
The following libnfs features are unimplemented here:
=over
=item * Authentication: Would be nice!
=item * URL parsing: Seems redundant with L<URI>.
=item * C<creat()> & C<create()>: These are redundant with C<open()>.
=item * C<access()> & C<access2()>: Merely knowing whether a given
file/directory is accessible isnât as useful as it may seem because
by the time you actually I<use> the resource the permissions/ownership
could have changed. To prevent that race condition itâs better just to
C<open()>/C<opendir()> and handle errors accordingly.
=item * C<lockf()>: Apparently redundant with C<fcntl()>-based locks save
for the lock-test functionality, which is generally a misstep for the same
reason as C<access()> above: by the time you use the resourceâin this case,
request a lock on the fileâthe system state may have changed.
=back
=head1 SEE ALSO
L<RFC 7530|https://datatracker.ietf.org/doc/html/rfc7530> is, as of this
writing, NFSv4âs official definition.
=head1 LICENSE & COPYRIGHT
Copyright 2022 Gasper Software Consulting. All rights reserved.
Net::LibNFS is licensed under the same terms as Perl itself (cf.
L<perlartistic>); B<HOWEVER>, since Net::LibNFS links to libnfs, use of
Net::LibNFS I<may> imply acceptance of libnfsâs own copyright terms.
See F<libnfs/COPYING> in this distribution for details.
( run in 1.445 second using v1.01-cache-2.11-cpan-71847e10f99 )