Lost Code

hello, I am new to programming and c++. I am currently programming on my mac on linux server and i ran into an issue. I don't know what I did to get this, and i just want my program back. Please help if you can! (I am new to this, so if you have instructions on how to fix this problem, please dumb it down for me as best as you can!)
Last edited on
https://imgur.com/a/SW81fAK

Image of what it looks like
This most likely happened because you got disconnected and tried to start a new session, right?

A “.swp” file is VIM’s (and hence, Nano’s) way of preserving your data.

It has been ages since I’ve used Nano, but you should have a menu option to “Recover (Last) Session” or something like that. If not, you can manually search for the .swp file.

The worst case scenario is that you have lost the data. This is part of the price of doing development over a network connection.

Best practice: develop on your home computer, make sure everything compiles, etc, then copy it to the school environment, make sure it compiles and works there, and submit it.

Good luck. Sorry I don't have better advice. There are a lot of *nix/Mac users here who might be able to help better if you let the topic sit for a bit. Alas, the longer you sit, the more likely your work will be permanently lost.
at the very least, write the code locally. "should" be able to copy and paste it into the remote nano session and go from there, and if it breaks, you still have it. If you don't have a local compiler and all on the mac, that will preserve your data. Alternately if you have a real mapped disk space on the remote machine, save frequently in nano and work there, but download back to the local machine every so often. One of the first things you need to master is how to transfer files to and from the remote machine, so you can back up your work as well as handle various other issues.

Personally I would get a nice IDE and code locally there, and upload when done, as was said, but you may not have time to figure all that out in the short term. In that case, just be sure to have copy on a disk you trust.

The last mac I developed on was a mac classic, lol. But I do a fair amount stuff that I push to a linux server @ work, and I code it locally in notepad++ and check it with cygwin before pushing it up.
Last edited on
Heh,
jonnin wrote:
...code it locally in notepad++ and check it with cygwin before pushing it up
I run Fedora on an Oracle VirtualBox, heh heh heh... Skips all the messing with cygwin...
the image, don't use the nano text editor,
download a c plus plus ide like code::blocks and use that,
linux terminals can sometimes get really annoying and unusable if yu are not experienced enough espically for coding .
Topic archived. No new replies allowed.