gpt4 book ai didi

windows - Windows 上的 perl : Can't do inplace edit on file: File exists

转载 作者:可可西里 更新时间:2023-11-01 10:02:29 29 4
gpt4 key购买 nike

我已经读过 thisthis问题,这让我想到:

for f in *.Xml
do
perl -pi.bak -e 's/\x03//g' "$f"
done
rm *.bak

我正在使用 for 循环并且我正在使用 -pi.bak。我仍然得到 Can't do inplace edit on 20180619.Xml: File exists.。我还从 Windows 的 cmd.exe 而不是 git bash 尝试了这个:

for %i in (*.Xml) do perl -pi.bak -e "s/\x03//g" "%i"

同样的事情。有什么想法吗?

版本信息:

$ perl --version

This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-msys-thread-multi

我使用的是最新版本的 Windows 10 专业版。

最佳答案

原来文件已被另一个进程打开(用于读取)。

$ handle 20180619.Xml

Nthandle v4.11 - Handle viewer
Copyright (C) 1997-2017 Mark Russinovich
Sysinternals - www.sysinternals.com

Rgui.exe pid: 11520 type: File 488: C:\20180619.Xml
Rgui.exe pid: 11520 type: File 530: C:\20180619.Xml
Rgui.exe pid: 11520 type: File 680: C:\20180619.Xml

杀死进程解决问题。

关于windows - Windows 上的 perl : Can't do inplace edit on file: File exists,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54189141/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com