E325: ATTENTION
Found a swap file by the name “.1.c.swp”
owned by: root dated: Wed Dec 6 12:42:36 2017
file name: /tjy/11.18/1.c
modified: YES
user name: root host name: localhost.localdomain
process ID: 7751
While opening file “1.c”
dated: Tue Dec 5 18:54:50 2017
(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use “:recover” or “vim -r 1.c”
to recover the changes (see “:help recovery”).
If you did this already, delete the swap file “.1.c.swp”
to avoid this message.
“1.c” 14L, 184C
Press ENTER or type command to continue
如果你是学C语言的新手,相信你一定遇到过这个问题,就是在你每次想要在终端打开源文件的时候会跳出来这些你看不懂的英文,下面我就来解释下它的意思以及产生的原因,最后怎么改正。
翻译:
E325: 注意
发现交换文件 “.1.c.swp”
所有者: root 日期: Wed Dec 6 12:42:36 2017
文件名: /tjy/11.18/1.c
修改过: 是
用户名: root 主机名: localhost.localdomain
进程 ID: 7751
正在打开文件 “1.c”
日期: Tue Dec 5 18:54:50 2017
(1) 另一个程序可能也在编辑同一个文件。
如果是这样,修改时请注意避免同一个文件产生两个不同的版本。
退出,或小心地继续。
(2) 上次编辑此文件时崩溃。
如果是这样,请用 “:recover” 或 “vim -r 1.c”
恢复修改的内容 (请见 “:help recovery”)。
如果你已经进行了恢复,请删除交换文件 “.1.c.swp”
以避免再看到此消息。
交换文件 “.1.c.swp” 已存在!
以只读方式打开([O]), 直接编辑((E)), 恢复((R)), 删除交换文件((D)), 退出((Q)), 中>
– 更多 –
我这里建立的一个1.c的文件,它的意思就是就是产生了一个 .1.c.swp的文件,与另一个程序编辑的文件同名,导致出错。
为什么会这样呢?
因为你上次在终端修改了它的内容未做保存就退出了,所以导致在下次运行时会出错。
怎么修改呢?
翻译已经告诉你该怎么做了,就是要删除 .1.c.swp这个文件,我们可以先在终端输入 ls -a来查看到这个文件,然后输入 rm -f .1.c.swp 这个命令来实现对 .1.c.swp这个文件的删除。