I am currently working on developing a remote desktop protocol, which includes a component for network disk redirection. Instead of using common protocols like SMB, FTP, or NFS, I am implementing a custom protocol for this purpose.
I am creating a custom filesystem on Linux using libfuse2 to map remote folders for remote access.
When redirecting multiple remote disks (folders), I will create multiple FUSE mount points. Additionally, I want these mount points to be visible in the file manager, providing ordinary users with access points for navigation.
I am attempting to place the FUSE mount points in the user's home directory, for example, /home/xxx/mount-D and /home/xxx/mount-C.I have also attempted to place the FUSE mount points in the "/media" directory, such as "/media/xxx/mount-D" and "/media/xxx/mount-C."
Based on the final outcome, I can only see the last redirected disk in the file manager, not both of them!
The code I use to create FUSE mount points is very simple. Here is a small snippet of my code.This code snippet is executed for each redirected disk, and m_rootPath represents the mount point path for each one.
int fuseArgc = 1; // argv count
char *fuseArgv[] = {"hsrclient"};
struct fuse_args args = FUSE_ARGS_INIT(fuseArgc, fuseArgv);
QDir dir(m_rootPath);
if( !dir.exists() )
{
if( !dir.mkpath(m_rootPath) )
{
qInfo()<<"[FuseFileSystem::startFuseLoop] dir.mkpath failed, mount point:" << m_rootPath;
}
}
m_fuseChan = fuse_mount(m_rootPath.toStdString().c_str(), &args);
if( !m_fuseChan )
{
qInfo("[FuseFileSystem::initFuse] fuse_mount failed.");
return;
}
m_fuse = fuse_new(m_fuseChan, &args, &m_fuseOps, sizeof(struct fuse_operations), this);
if( !m_fuse )
{
qInfo("[FuseFileSystem::initFuse] fuse_new failed.");
return;
}
if( fuse_daemonize(1) != 0 )
{
qInfo("[FSRDR]Hsrfs::run calls fuse_daemonize failed.");
return;
}
int ret = fuse_loop(m_fuse);
。。。。。。。。。。。。。。。。 I searched for some information, but it was all about gio and gvfs, and I don't know the difference between them and fuse mount when it comes to mounting disks. I attempted to add the mount parameter "x-gvfs-show" to fuse_mount, but it prompted that FUSE does not support this parameter.
Who can help me? Let me reiterate my question: my application will run on most Linux graphical systems, such as various versions of Ubuntu and Debian. I am using FUSE to mount multiple disks on Linux, and I want them to be displayed in the file manager.
