LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-13-2004, 01:26 AM   #1
praveenv
Member
 
Registered: Aug 2004
Location: India
Posts: 54

Rep: Reputation: 15
Unhappy .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)
 
Old 08-13-2004, 01:57 AM   #2
hiteshmaisheri
Member
 
Registered: Nov 2003
Location: Kerala, India
Distribution: Red Hat, Knoppix, Mandrake, FreeBSD
Posts: 231

Rep: Reputation: 30
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...
 
Old 08-13-2004, 01:58 AM   #3
spurious
Member
 
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558

Rep: Reputation: 31
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
 
Old 08-13-2004, 02:12 AM   #4
hiteshmaisheri
Member
 
Registered: Nov 2003
Location: Kerala, India
Distribution: Red Hat, Knoppix, Mandrake, FreeBSD
Posts: 231

Rep: Reputation: 30
Thank you spurious for more information on the topic.
 
Old 08-13-2004, 06:14 AM   #5
praveenv
Member
 
Registered: Aug 2004
Location: India
Posts: 54

Original Poster
Rep: Reputation: 15
Smile .swp file

thnaku friends Now my problem solved.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to deal with huge swp files such as .store.log.2.swp from squid directory? Niceman2005 Linux - General 2 11-01-2005 07:25 AM
removing hidden .swp files blackzone Linux - Newbie 1 08-26-2004 02:49 AM
How to play a media file/ video file/mp3 file recorded in harddisk/cd-rom arindam Linux - Newbie 2 09-05-2003 10:31 AM
/etc/mail/access.swp ppuddick Linux - Networking 2 05-02-2003 01:06 PM
.swp files sadiboyz Linux - Newbie 2 05-01-2003 11:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration