我在Linux系统下使用Vim编写test.c文件时出现了以下问题信息:
E325: ATTENTION
Found a swap file by the name ".test.c.swp"
owned by: eHunter dated: Mon Mar 23 18:07:33 2020
file name: ~eHunter/project/test.c
modified: YES
user name: eHunter host name: eHunter-VirtualBox
process ID: 3315
While opening file "test.c"
dated: Tue Mar 24 09:06:23 2020
NEWER than swap file!
(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 test.c"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".test.c.swp"
to avoid this message.
Swap file ".test.c.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
原因是我在用vim编写test.c文件的代码时,由于电脑死机而重启之后再进去继续用vim编写test.c时出现了这些信息,因为电脑死机直接断开了电源而导致文件出现了异常中断错误,所以产生了一个.test.c.swp隐藏文件,把该文件删除就可以了。
注:使用ls命令是查看不到该隐藏文件的,用ll命令就可以看到。