LinuxQuestions.org
Help answer threads with 0 replies.
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 11-09-2012, 06:31 AM   #1
Shahid nx
Member
 
Registered: Jan 2012
Posts: 46

Rep: Reputation: Disabled
How to recover swap file in c/c++?


Hi All,
plz need urgent help. In our server 4 peoples were working and accessing the same file from their system. But some has bymistakenly erased the data of that file but i have a swap file (.swp) of that .cc file .. Is there any way to get actual data using this swap file,,

Thnks
shahid nx
 
Old 11-09-2012, 06:36 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
you're referring to vi I take it?? please provide useful amoutns of informatino if you want help...

if it is vi, I think even without the original file this should work:

Code:
:rec[over] [file]	Try to recover [file] from the swap file.  If [file]
			is not given use the file name for the current
			buffer.  The current contents of the buffer are lost.
			This command fails if the buffer was modified.
Also it seems possible to just edit the file as if it was still there and it will automatically look for the backup

Code:
vi filethatwasdeleted.cc

Last edited by acid_kewpie; 11-09-2012 at 06:40 AM.
 
  


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
[SOLVED] what the difference swap space and swap file dundu Linux - Newbie 4 07-29-2012 12:03 PM
Can swap file or a swap partition be mounted and read? Mr-Bisquit Linux - General 3 06-08-2009 02:16 PM
swap file or swap space? simonb1975uk Linux - General 11 08-15-2008 02:39 PM
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 08:04 AM
(hard one) cant mount ext2(or swap) anymore - recover data pawn-o-matic Linux - Hardware 3 03-24-2005 02:17 PM

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

All times are GMT -5. The time now is 08:03 PM.

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
Open Source Consulting | Domain Registration