WebDav使用WinFsp + rclone,编译rclone没有mount命令

  • Post author:
  • Post category:其他




摘要:

1、使用 WinFsp + rclone 作为网盘的WebDAV映射到本地资源管理器的工具。

2、编译 rclone 不含有mount、mount2、cmount等功能,手动添加改部分功能,查看

官方论坛

的提问逐渐了解rclone该问题解决方案。

3、报错: Error: unknown command “mount” for “rclone”



一、下载



1.

WinFsp – Windows File System Proxy


下载最新WinFsp



2.

rclone



二、原版rclone 安装与使用



1. 安装WinFsp (可以安装非C盘,暂用D:\WinFsp)

在这里插入图片描述



2. 安装rclone

  1. 双击压缩包内的rclone安装包进行安装



3. 使用

  1. 执行rclone.exe config 进行配置
  2. 正常使用



三、搭建环境编译、修改后使用



1. 安装WinFsp (可以安装非C盘,暂用D:\WinFsp)

在这里插入图片描述

  • 注意:勾选上全部选项。



2. 使用Goland打开rclone项目

在这里插入图片描述

在这里插入图片描述

直接选择 “Open Project”,作为项目直接打开。



3. 创建 “Go 构建”,并填入以下参数,注意画框部分

在这里插入图片描述



4. 修改代码

  • 添加mount、mount2、cmount等功能(仅测试添加mount,其他未测试,方式应该一致)
  • 修改 cmd/cmount/mount.go 文件前几行,加入windows
// Package mount implements a FUSE mounting system for rclone remotes.

//go:build cmount && cgo && (linux || darwin || freebsd || windows || illumos)
// +build cmount
// +build cgo
// +build linux darwin freebsd windows illumos
  • 此时编译会出现以下问题:
D:\GoPath\pkg\mod\github.com\billziss-gh\cgofuse@v1.5.0\fuse\host_cgo.go:206:10: fatal error: fuse_common.h: No such file or directory
 #include <fuse_common.h>
          ^~~~~~~~~~~~~~~
compilation terminated.



4. 拷贝文件、编译

  • 此时打开WinFsp安装目录,打开 “inc\fuse” 目录,拷贝4个.h文件到报错文件host_cgo.go目录下
  • 点击编译按钮,编译通过,运行编译的rclone 含有mount功能。



版权声明:本文为a_917原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。