LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to recover swap file in c/c++? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-recover-swap-file-in-c-c-4175436393/)

Shahid nx 11-09-2012 06:31 AM

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

acid_kewpie 11-09-2012 06:36 AM

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


All times are GMT -5. The time now is 04:53 PM.