Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不同步符号链接 #3020

Closed
HowcanoeWang opened this issue Sep 30, 2021 · 3 comments
Closed

不同步符号链接 #3020

HowcanoeWang opened this issue Sep 30, 2021 · 3 comments
Assignees
Milestone

Comments

@HowcanoeWang
Copy link

HowcanoeWang commented Sep 30, 2021

Describe the problem

使用mklink或ln,对同步屏蔽列表中的文件夹建立软连接后,软件无法进行同步

Expected result

判断文件夹是否为软连接,如果是则视作正常文件夹进行处理

Screenshot or screen recording presentation

syncignore文件:

assets/**/*

Win端使用mklink /J的效果
image
同步的报错:
image

Mac端使用ln -s建立的效果
image
同步时的报错:
image

Version environment

  • Version: 1.3.8
  • Operating system: Win10 + Mac

Log File

E 2021/09/30 13:56:10 sync.go:506: read file [D:\AppData\SiYuanNote\data\assets] failed: read D:\AppData\SiYuanNote\data\assets: The handle is invalid.
E 2021/09/30 13:56:10 sync.go:338: encrypt data dir failed: read D:\AppData\SiYuanNote\data\assets: The handle is invalid.

PS

1.3.7版本中,只要屏蔽列表设置为

assets

表现正常,图片附件显示与添加没有任何问题,除了有一次遇到会删除该软连接
#2998

@88250 88250 self-assigned this Sep 30, 2021
@88250 88250 changed the title 将mklink与ln生成的软连接视为正常文件夹 同步时将符号链接目录视为正常文件夹 Sep 30, 2021
@88250
Copy link
Member

88250 commented Sep 30, 2021

目前的同步是 follow symlink 的,也就是说同步后云端是保存了符号链接实际指向的真实文件。

估计只能做成同步时不跟随符号链接,而是同步符号链接本身这个文件。因为如果一旦跟随,云端存了真实文件,那么另一个设备上就只能下载到真实文件了,会出现删除已有符号链接的情况。

@88250 88250 changed the title 同步时将符号链接目录视为正常文件夹 同步时不跟随符号链接 Sep 30, 2021
@88250 88250 added this to the 1.3.9 milestone Sep 30, 2021
@88250 88250 changed the title 同步时不跟随符号链接 不同步符号链接 Sep 30, 2021
@HowcanoeWang
Copy link
Author

HowcanoeWang commented Sep 30, 2021

目前的同步是 follow symlink 的,也就是说同步后云端是保存了符号链接实际指向的真实文件。

估计只能做成同步时不跟随符号链接,而是同步符号链接本身这个文件。因为如果一旦跟随,云端存了真实文件,那么另一个设备上就只能下载到真实文件了,会出现删除已有符号链接的情况。

可能要分成两种情况,一种是文件符号链接,一种是文件夹符号链接;
而且win系统的符号链接和mac系统的符号链接,似乎也是不同的两种文件类型;
这样整起来感觉复杂度非常高=_=

我的应用场景是,只要涉及到符号链接,那这个路径一定会存在于syncignore中;或许可以用这个思路,一旦检测到符号链接,自动添加到syncignore文件,忽略同步?

@88250
Copy link
Member

88250 commented Sep 30, 2021

我也倾向于直接忽略符号链接。

@88250 88250 closed this as completed Sep 30, 2021
88250 added a commit to siyuan-note/user-guide-zh_CN that referenced this issue Sep 30, 2021
88250 added a commit to siyuan-note/user-guide-en_US that referenced this issue Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants