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

摘要:

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功能。
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值