NAME
Fuse::PerlSSH::FS - Mount a remote filesystem via FUSE and PerlSSH
SYNOPSIS
use Fuse::PerlSSH::FS;
my $fpfs = Fuse::PerlSSH::FS->new(
host => 'example.com',
port => 22,
user => 'user',
mountpoint => '/mnt/remote',
);
$fpfs->mount();
DESCRIPTION
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.
Why would I want to use perlsshfs and not 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..)
METHODS
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.
new()
mount()
umount()
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,
EXPORT
None by default.
CAVEATS or TODO
Reliability
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.
Remote "capabilities"
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.
(Local) FUSE limitations
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.
No keep-alive
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.
SEE ALSO
FUSE, IPC::PerlSSH. Filesys::Virtual::SSH.
AUTHOR
Clipland GmbH http://www.clipland.com/
COPYRIGHT & LICENSE
Copyright 2012-2013 Clipland GmbH. All rights reserved.
This library is free software, dual-licensed under GPLv3/AL2. You can redistribute it and/or modify it under the same terms as Perl itself.