搜索
bottom↓
回复: 11

用secureRT登陆linux虚拟机,进入uboot目录下发现无法修改文件

[复制链接]

出0入0汤圆

发表于 2013-5-3 14:14:02 | 显示全部楼层 |阅读模式
本帖最后由 yidehui 于 2013-5-3 14:42 编辑

book@book-desktop:/work/system/u-boot-1.1.6/common$ vi Makefile

回车enter

E325: ATTENTION
Found a swap file by the name ".Makefile.swp"
          owned by: book   dated: Fri May  3 13:28:50 2013
         file name: /work/system/u-boot-1.1.6/common/Makefile
          modified: YES
         user name: book   host name: book-desktop
        process ID: 2177 (still running)
While opening file "Makefile"
             dated: Fri May  3 13:48:55 2013
      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 Makefile"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".Makefile.swp"
    to avoid this message.

Swap file ".Makefile.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:

选择E(.Makefile.swp文件我后来删除了,再次打开makefile文件,就没有这个提示。但是问题还没有完!)

以下是Makefile一部分,但是用键盘无法添加一些.o文件,也就是无法编辑,我试了6次,印象里只有1次能编辑,这是怎么回事!?
有时候按下键盘的字母,发现光标跳来跳去,有时无缘无故就把一行代码给删了!
还有一次,想在这行virtex2.o xilinx.o crc16.o xyzModem.o cmd_mac.o 后面加上cmd_hello.o,用键盘敲上去后,整行代码被删了!

COBJS   = main.o ACEX1K.o altera.o bedbug.o circbuf.o \
          env_nvram.o env_nowhere.o \
          exports.o \
          flash.o fpga.o ft_build.o \
          hush.o kgdb.o lcd.o lists.o lynxkdi.o \
          memsize.o miiphybb.o miiphyutil.o \
          s_record.o serial.o soft_i2c.o soft_spi.o spartan2.o spartan3.o \
          usb.o usb_kbd.o usb_storage.o \
          virtex2.o xilinx.o crc16.o xyzModem.o cmd_mac.o

阿莫论坛20周年了!感谢大家的支持与爱护!!

知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)

出0入0汤圆

发表于 2013-5-3 14:23:36 | 显示全部楼层
上次编辑时意外退出了。

出0入0汤圆

发表于 2013-5-3 14:24:21 | 显示全部楼层
rm  .Makefile.swp
也就是说,删除  .Makefile.swp 这个文件即可

出0入0汤圆

发表于 2013-5-3 14:27:13 | 显示全部楼层
兄弟,看看提示。vim -r Makefile 也可以。办法有很多。。。。
人家都告诉了:
(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 Makefile"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".Makefile.swp"
    to avoid this message.

Swap file ".Makefile.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:

出0入0汤圆

 楼主| 发表于 2013-5-3 14:34:55 | 显示全部楼层
本帖最后由 yidehui 于 2013-5-3 14:41 编辑
postek 发表于 2013-5-3 14:27
兄弟,看看提示。vim -r Makefile 也可以。办法有很多。。。。
人家都告诉了:
(1) Another program may be ...


我已经删了swp文件,现在没有这个警告了

出0入0汤圆

 楼主| 发表于 2013-5-3 14:35:53 | 显示全部楼层
本帖最后由 yidehui 于 2013-5-3 14:41 编辑
postek 发表于 2013-5-3 14:27
兄弟,看看提示。vim -r Makefile 也可以。办法有很多。。。。
人家都告诉了:
(1) Another program may be ...


有时候按下键盘的字母,发现光标跳来跳去,有时无缘无故就把一行代码给删了!
还有一次,想在这行virtex2.o xilinx.o crc16.o xyzModem.o cmd_mac.o 后面加上cmd_hello.o,用键盘敲上去后,整行代码被删了!


我发现无法正常编辑时,光标无法移到最左边,上面正常可编辑时就可以移到o的右边处!!!!!!!!!!!!!!这是怎么回事!


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2013-5-3 14:45:07 | 显示全部楼层

没有无缘无故的事儿。

出0入0汤圆

发表于 2013-5-3 14:45:46 | 显示全部楼层
“有时无缘无故就把一行代码给删了!”
是连按两下 d吧?

出0入0汤圆

发表于 2013-5-3 14:46:50 | 显示全部楼层
lz不熟悉vim吧。可以用nano之类的编辑器,和notepad操作习惯相同

vim分编辑模式和命令模式。

出0入0汤圆

发表于 2013-5-3 14:48:11 | 显示全部楼层
给个建议:
1 练习VIM。
2 变通一下:在linux 下开个 smb,在windows下访问。用windows下的记事本啊、ultraedit、si等等编辑器来编辑。

出0入0汤圆

 楼主| 发表于 2013-5-3 15:05:15 | 显示全部楼层
postek 发表于 2013-5-3 14:48
给个建议:
1 练习VIM。
2 变通一下:在linux 下开个 smb,在windows下访问。用windows下的记事本啊、ultrae ...


按下切换键就没问题了,感觉简单的编辑直接在linux操作就行了,把文件从虚拟机上拖拽到window来编辑感觉好麻烦!对了,你说的smb服务,我没用过,我一向来都是用cuteftppro在两个系统间拖拽文件的,使用smb会更方便吗

出0入0汤圆

发表于 2013-5-3 16:31:22 | 显示全部楼层
yidehui 发表于 2013-5-3 15:05
按下切换键就没问题了,感觉简单的编辑直接在linux操作就行了,把文件从虚拟机上拖拽到window来编辑感觉 ...

嗯。会比较方便。
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-7-23 10:28

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表