Fuse::PerlSSH::FS - Mount a remote filesystem via FUSE and PerlSSH
use Fuse::PerlSSH::FS; my $fpfs = Fuse::PerlSSH::FS->new( host => 'example.com', port => 22, user => 'user', mountpoint => '/mnt/remote', ); $fpfs->mount();
The mounting script perlsshfs found in this distribution and its backend module Fuse::PerlSSH::FS (this here) is meant as a drop-in replacement for sshfs, written in Perl. The primary goal, for now, is to add extended file attribute (xattr) functionality to the mounted filesystem and only later to achieve the full feature-level of sshfs.
The sole motivation behind doing this is that sshfs won't support extended file attributes (xattr) anytime soon, as it relies on openssh's "internal FTP server". SFTP doesn't expose functions to manipulate extended attributes on remote files, thus the sshfs developers tend to ignore xattr. (Although there's a patched version of sshfs floating around that in turn requires a patched version of openssh..)
Right now, the module offers some OO-ish methods, and some plain functions. The mounting script uses the below OO methods new(), mount() and umount(). But note the quirk that $self is stored in a global our variable, to mediate between the OO API and the Fuse-style functions.
A growing list of functions that match the FUSE bindings, all prefixed by "local_":
local_readdir, local_getattr, local_mknod, local_mkdir, local_rmdir, local_rename, local_unlink, local_open, local_read, local_write, local_release, local_symlink, local_link, local_readlink, local_utime, local_truncate, local_ftruncate, local_statfs, local_listxattr, local_getxattr, local_setxattr, local_removexattr,
None by default.
Most tests via Test::Virtual::Filesystem succeed but some still fail. So keep in mind that this is beta quality code and don't rely on it to transfer critical data.
This module here requires Perl to be installed on the remote machine and File::ExtAttr to be installed. On connect some rudimentary checks are performed to find out what the remote system is able to do, especially regarding xattribs - but that might not reveal any problem. So make sure the remote file-system is able to accept xattr calls (is mounted with the user_xattr option, or similar, on non *nix systems) and that the ssh host has File::ExtAttr in place, if you want to use xattribs.
Keep in mind that even when the underlying filesystem on the remote end has everything in place for extended attribs, your local stack might be incomplete. As of this writing, FUSE implementations on NetBSD and FreeBSD do not support xattr, for example.
Currently, there's no keep-alive mechanism and the automatic reconnect generally fails. So the mount might become unresponsive after a certain time of inactivity.
Clipland GmbH http://www.clipland.com/
Copyright 2012-2013 Clipland GmbH. All rights reserved.