zoukankan      html  css  js  c++  java
  • Swap file ".Podfile.swp" already exists!

    解决Swap file ".ceshi.c.swp" already exists!问题

    关于swp文件:使用vi,经常可以看到swp这个文件,那这个文件是怎么产生的呢,当你打开一个文件,vi就会生成这么一个.(filename)swp文件以备不测,如果你正常退出,那么这个.(filename)swp文件将会自动删除。
    因此.(filename)swp文件就是你没有正常退出vi或者vim编辑器时留下来的!比如:强行关闭vi或vim时,电源突然断掉,或者你使用了Ctrl-zz。(正常的退出方式应该是Shift-ZZ)
    这时候就会出现下面的情况了
    1. <span style="font-family:SimSun;color:#ffffff;background-color: rgb(0, 0, 0);">E325: ATTENTION  
    2. Found a swap file by the name ".ceshi.c.swp"  
    3.           owned by: root   dated: Sat Jul  4 19:51:46 2015  
    4.          file name: /c/ceshi.c  
    5.           modified: YES  
    6.          user name: root   host name: c66-WR  
    7.         process ID: 2801  
    8. While opening file "ceshi.c"  
    9.              dated: Sun Jul  5 12:38:54 2015  
    10.       NEWER than swap file!  
    11.   
    12. (1) Another program may be editing the same file.  
    13.     If this is the case, be careful not to end up with two  
    14.     different instances of the same file when making changes.  
    15.     Quit, or continue with caution.  
    16.   
    17. (2) An edit session for this file crashed.  
    18.     If this is the case, use ":recover" or "vim -r ceshi.c"  
    19.     to recover the changes (see ":help recovery").  
    20.     If you did this already, delete the swap file ".ceshi.c.swp"  
    21.     to avoid this message.  
    22.   
    23. Swap file ".ceshi.c.swp" already exists!  
    24. [O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit:</span>  


    重点:解决办法

      用下面的命令删除swp文件

        rm .{your file name}.swp

        例如:我的文件名是ceshi.c 那么就用这样的命令:rm .ceshi.c.swp (当然你前面也可以加-rf强制删除)


    问: (vi 一个文件时怎么样可以不让它产生.swp文件?或不让他提示【“Swap file ".文件名.swp" already exists![O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit:】)

    处理方法: 打开 vi /etc/vimrc 并在末尾添加 set noswapfile 后保存退出 OK

  • 相关阅读:
    Debian如何永久添加静态路由
    一句话换个说法的软件
    高级程序员简历,技术总监喜欢什么简历?
    CP936实际上是GBK,编码问题再次让我熬夜
    句子说法转换的软件,基于AI技术
    输入关键词自动生成文章(2020年人工智能写作)
    自动写文章的智能软件(基于AI写作)
    python调用接口,python接收post请求接口(附完整代码)
    人工智能是铁饭碗还是铁坑,看看人工智能博士怎么说
    远离外包公司,就是远离码农的血汗工厂
  • 原文地址:https://www.cnblogs.com/crazygeek/p/5599752.html
Copyright © 2011-2022 走看看