feat(alias): support writing to non-ambiguous paths#8216
Merged
xhofe merged 3 commits intoAlistGo:mainfrom Mar 27, 2025
KirCute:feat/alias-writable
Merged
feat(alias): support writing to non-ambiguous paths#8216xhofe merged 3 commits intoAlistGo:mainfrom KirCute:feat/alias-writable
xhofe merged 3 commits intoAlistGo:mainfrom
KirCute:feat/alias-writable
Conversation
xhofe
approved these changes
Mar 27, 2025
|
A B |
|
a:驱动1路径 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
别名驱动支持所有不冲突路径的写入操作。
举例说明:假设 A,B 两驱动的内容如下:
现将它们引入到一个别名驱动内,打开别名驱动的“可写”和“同名保护”两个选项,则
/dir1下不可以上传文件、创建文件夹,也不能作为驱动内复制、移动、解压操作的目标文件夹(以下称“写入操作”),因为 A、B 两驱动都有路径/dir1,不能确定在此处进行写入操作时应该写入到哪个驱动。/下不可以进行写入操作,原因同上, A、B 两驱动都有根目录/。/dir1/dir2下可以进行写入操作,因为只有驱动 A 有文件夹dir2,在此处写入不存在歧义,如果手动在驱动 B 的文件夹dir1下创建文件夹dir2,则/dir1/dir2会重新变得不可写入。/dir3下可以进行写入操作,原因同上。/dir1/file1不可以作为驱动内复制、移动、解压操作的源文件,也不可以删除或重命名,因为不能确定进行操作的文件来自哪个驱动。/dir1不可以被复制、移动、解压、删除、重命名,原因同上。/dir1/file2可以被复制、移动、解压、删除、重命名(请注意,此处对删除和重命名操作的支持并不来源于这个 PR,而是来源于 feat(alias): support Rename and Remove #6478),因为对其操作是无歧义的。对于不展开用法,例如如下配置:
则
/目录不可写/a目录不可写,原因与展开用法的/不可写一致/b目录可以作为驱动内复制、移动、解压操作的目标文件夹,可以上传子文件和创建子文件夹,但不可以被复制、移动、删除、重命名关闭“同名保护”时,所有冲突操作优先对排序在上的驱动进行,这种用法的稳定性未知,不建议这么使用。
alias 驱动新加入配置选项“可写”,只有打开时这个 PR 提供的特性才会发生作用,此外,原 #6478 提供的特性现在也必须打开“可写”才能使用。