LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   .file.swp (https://www.linuxquestions.org/questions/linux-newbie-8/file-swp-217006/)

praveenv 08-13-2004 01:26 AM

.file.swp
 
hI Friends !

Sometimes When I open a file In vi-Editor for example assume I opened FILE NAMED file(already created), then it displays .file.swp already exists and asks me for some options to choose (like Edit ,Recovery and Delete ,etc...) why this is happening and where do .swp file resides ?


Thanku inadvance(kindly help regarding this)

hiteshmaisheri 08-13-2004 01:57 AM

Hi praveenv,
this occurs only when the file is not saved incompletely on to the disk. That is in cases like
1) when you shut down your system, when a file is open in vi.
2) when your file is being accesed by more than one person from differnet consoles in vi.

vi creates a .swp file whenever a file is opened in vi. Everytime a file is opened in vi, vi checks for this file and if a file like this is found vi gives you this message.
This is can be avoided in two ways
one by deleting the .swp file which is named as ".<your file's name>.swp"
this i would not suggest u.
preferably go for recovery by pressing eneter when u get the message...

spurious 08-13-2004 01:58 AM

This happens when you inadvertently exit vi without quitting. The .swp file is the last auto-save. Choose "recover" if you want to restore from the last backup, then :x the restored document. If you don't want that message to appear again, either choose "delete" or just do rm *.swp

hiteshmaisheri 08-13-2004 02:12 AM

Thank you spurious for more information on the topic.

praveenv 08-13-2004 06:14 AM

.swp file
 
thnaku friends Now my problem solved.


All times are GMT -5. The time now is 07:43 AM.