1828667 Members
1776 Online
109984 Solutions
New Discussion

Re: vi warning message

 
Tonatiuh
Super Advisor

vi warning message

When I onvoke vi from inside an Oracle sqlplus session, always shows this message and I have to press any key to go on.

==============================
E325: ATTENTION
Found a swap file by the name ".afiedt.buf.swp"
owned by: oracle dated: Tue Feb 8 17:18:57 2005
file name: ~oracle/afiedt.buf
modified: YES
user name: oracle host name: Ita1
process ID: 30863
While opening file "afiedt.buf"
dated: Mon Apr 18 21:36:11 2005
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 afiedt.buf"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".afiedt.buf.swp"
to avoid this message.
"afiedt.buf" 2L, 44C
Hit ENTER or type command to continue
=========================================

How can I force to vi to omit this message?
8 REPLIES 8
Rick Garland
Honored Contributor

Re: vi warning message

Not sure you want vi to omit this message.

It is telling you that the file you are opening with vi is already open for modifications by another process.

For this particular instance I can see ommitting this message, but not for "all the time".
Tonatiuh
Super Advisor

Re: vi warning message

I do not know why vi says that the file is opened. But Oracle SQL*Plus always open a file with the same name.

I want to quito this message just to omit the need to press any anditional key when it opens.
Stuart Browne
Honored Contributor

Re: vi warning message

Well, if no other 'vi' sessions have the file open, just remove the tempoary file:

rm -r .afiedt.buf.swp

It sounds like a session once was viewing/modifying the file when a crash occured (or the process was killed), leaving the temporary file in place behind.

Or if you aren't actually *MODIFYING* the file, just use 'view afiedt.buf' instead. It bypasses that check.
One long-haired git at your service...
renarios
Trusted Contributor

Re: vi warning message

Hi Tonatiuh,

If you open an SQL*PLUS session and execute a query, automatically an afiedt.buf will be created in the current working directory.
I don't know why you'd like to edit the file using vi, but if you would like to edit the buffer, just type ed or edit in your SQL*PLUS session and your default text editor (hopefully vi) will be opened. If you close the editor, you will return in your SQL*PLUS session.
Do you now still encounter the issues?
I suggest creating scripts with vi and running them from SQL*PLUS.

Cheers,

Renarios
Nothing is more successfull as failure
Alexander Chuzhoy
Honored Contributor

Re: vi warning message

use ps -aux |grep afiedt.buf to see the process id of process that holds the file.
Then kill it.
Best regards.
Tonatiuh
Super Advisor

Re: vi warning message

Stuart, Alexander,

The thing I am looking for is tho press one key less. The comments from you, mean to press much more keys.

Renarios,
SQL*Plus always use this fiel by default. And is common to edit a statament because I need to modify it or correct it. I maybe edit (with this process) stataments nearly a hundred of times daily.
Stuart Browne
Honored Contributor

Re: vi warning message

yea, but after you've removed the .swp file, does the warning go away? or does it come back again?
One long-haired git at your service...
renarios
Trusted Contributor

Re: vi warning message

If you are not allowed to overwrite your own afiedt.buf, I should almost think that it is a privilege issue. Do you have the right session umask and rights in your directory?
If you change the name of the editfile does the error still occur? command:
set editfile "edit.buf"

Cheers,

Renarios
Nothing is more successfull as failure