Skip to content

Renaming a directory using the kernel API /api/file/renameFile indicates that the file is in use #8635

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

Closed
3 tasks done
Zuoqiu-Yingyi opened this issue Jun 28, 2023 · 0 comments
Assignees
Milestone

Comments

@Zuoqiu-Yingyi
Copy link
Contributor

Zuoqiu-Yingyi commented Jun 28, 2023

使用 API /api/file/renameFile 重命名目录时提示文件被占用

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

使用 API /api/file/renameFile 重命名目录, 若 newPath 指定的目录为已经存在的目录, 则提示 🚒 已成功避免潜在的数据损坏
Rename the directory using API /api/file/renameFile, if the directory specified by newPath is an existing directory, it will indicate Successfully avoid potential data corruption

下面是复现步骤
Here are the steps to reproduce

  1. 新建目录 temp/convert/pandoc/test/rename-dir/temp/convert/pandoc/test/rename-dir-new/
  2. 调用 API /api/file/renameFile, 请求体如下所示
{
    "path": "temp/convert/pandoc/test/rename-dir/",
    "newPath": "temp/convert/pandoc/test/rename-dir-new/"
}

Expected result

newPath 指定了一个已存在的目录, 应返回错误信息作为响应体而不是直接退出内核
If 'newPath' specifies a directory that already exists, it should return an error message as response body instead of exiting the kernel directly

Screenshot or screen recording presentation

No response

Version environment

- Version: 2.9.3
- Operating System: 
- Browser (if used):

Log file

F 2023/06/29 00:23:53 filelock.go:78: rename [p=D:\Note\siyuan\workspace\temp\convert\pandoc\test\rename-dir, newP=D:\Note\siyuan\workspace\temp\convert\pandoc\test\rename-dir-new] failed: rename D:\Note\siyuan\workspace\temp\convert\pandoc\test\rename-dir D:\Note\siyuan\workspace\temp\convert\pandoc\test\rename-dir-new: Access is denied.

More information

No response

@88250 88250 self-assigned this Jun 29, 2023
@88250 88250 changed the title 使用 API /api/file/renameFile 重命名目录时提示文件被占用 | Renaming a directory using the API /api/file/renameFile indicates that the file is in use Renaming a directory using the kernel API /api/file/renameFile indicates that the file is in use Jun 29, 2023
@88250 88250 added this to the 2.9.4 milestone Jun 29, 2023
88250 added a commit that referenced this issue Jun 29, 2023
@88250 88250 closed this as completed Jun 29, 2023
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