当前位置:网站首页>vim 出现 Another program may be editing the same file. If this is the case 的解决方法
vim 出现 Another program may be editing the same file. If this is the case 的解决方法
2022-07-04 12:32:00 【码农研究僧】
问题所示
通过vim或者vi编辑文件的时候出现如下所示:
终端显示如下:
Found a swap file by the name "/mydata/mysql/conf/.my.conf.swp"
owned by: root dated: Sat Jul 02 12:52:53 2022
file name: /mydata/mysql/conf/my.conf
modified: YES
user name: root host name: xx
process ID: xx
While opening file "/mydata/mysql/conf/my.conf"
CANNOT BE FOUND
(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 /mydata/mysql/conf/my.conf"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/mydata/mysql/conf/.my.conf.swp"
to avoid this message.
Swap file "/mydata/mysql/conf/.my.conf.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
截图如下:
2. 原理分析
在linux中系统为了保证安全性,如果文件遭到不一
比如多人编辑这个文件导致文件的不一、上次编辑没有正常退出等
会将其文件后缀生成一个swp格式的文件(临时交换文件,主要备份缓冲区内容)
保存或者写入文件的方式无误,一般swp格式文件都会自动删除,如果写入有误,临时文件就会一直存在,再次编辑的时候就会一直指到改文件
将其删除重新编辑或者恢复重新编辑即可
3. 解决方法
通过ls -al查看全部文件的时候
可以看到swp格式(隐藏临时文件,临时缓冲区)
vim编辑出现的提示:
根据如下提示对应解决
如果文件不重要,直接q退出,rm -rf删除重新再来即可
边栏推荐
- AI should take code agriculture? Deepmind offers a programming version of "Alpha dog" alphacode that surpasses nearly half of programmers!
- 03_ Armv8 instruction set introduction load and store instructions
- Video analysis
- QQ group administrators
- Entitas learning [3] multi context system
- 2021-10-20
- A few words explain redis cache penetration, breakdown, avalanche, and redis sentinel
- MySQL advanced review
- It's hard to hear C language? Why don't you take a look at this (V) pointer
- template<typename MAP, typename LIST, typename First, typename ... Keytypes > recursive call with indefinite parameters - beauty of Pan China
猜你喜欢

Single spa, Qiankun, Friday access practice

CSDN documentation specification

Exness: positive I win, negative you lose
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8](/img/16/33f5623625ba817e6e022b5cb7ff5d.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13](/img/29/49da279efed22706545929157788f0.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13

2018 meisai modeling summary +latex standard meisai template sharing

Introduction of network security research direction of Shanghai Jiaotong University

Detailed explanation of NPM installation and caching mechanism
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 18](/img/1a/94ef8be5c06c2d1c52fc8ce7f03ea7.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 18
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19](/img/7c/f728e88ca36524f92c56213370399b.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19
随机推荐
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19
French Data Protection Agency: using Google Analytics or violating gdpr
MySQL advanced (Advanced) SQL statement
Function parameters (positional parameters, default value parameters, variable parameters, named keyword parameters, keyword parameters)
C language compilation process
Single spa, Qiankun, Friday access practice
os. Path built-in module
2018 meisai modeling summary +latex standard meisai template sharing
2021-08-09
Guava ImmutableSet. Builder source code analysis, shift original code, complement code, reverse code review
Exness: positive I win, negative you lose
[directory] search
2021-10-20
Translation D29 (with AC code POJ 27:mode of sequence)
How to use "bottom logic" to see the cards in the world?
The detailed installation process of Ninja security penetration system (Ninjitsu OS V3). Both old and new VM versions can be installed through personal testing, with download sources
Googgle guava ImmutableCollections
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6
Azure solution: how can third-party tools call azure blob storage to store data?