Python Forum
Recovering lost source code when the code is running in memory - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: Recovering lost source code when the code is running in memory (/thread-2376.html)

Pages: 1 2


Recovering lost source code when the code is running in memory - micseydel - Mar-11-2017

I think that this question came up multiple times on previous incarnations of the forum, and when I saw the following I wanted to get it documented here for the next time - https://gist.github.com/simonw/8aa492e59265c1a021f5c5618f9e6b12


RE: Recovering lost source code when the code is running in memory - Skaperen - Mar-29-2017

is this better than making backups?


RE: Recovering lost source code when the code is running in memory - micseydel - Mar-29-2017

Certainly not. It solves a different problem.


RE: Recovering lost source code when the code is running in memory - Skaperen - Mar-29-2017

(Mar-29-2017, 02:16 AM)micseydel Wrote: Certainly not. It solves a different problem.

it looked like the same problem to me:  user error with the rm or delete command.  need to restore the lost file.


RE: Recovering lost source code when the code is running in memory - micseydel - Mar-29-2017

One solves the problem proactively. You must take prior action. It's more effective. It's great.

The other is an "oh shit, I didn't do anything to protect myself" kinda thing and is useful when accidents happen. I'm not going to lose committed code, but accidents do happen sometimes.


RE: Recovering lost source code when the code is running in memory - Skaperen - Mar-30-2017

my editor command (aliased as "e" ,,, how i use it). make a date-time stamped backup each time i edit the file.  i should mod it to make repo commits and make public.  i've been doing this for at least the past 15 years.  i rewrote it into python just last month Dance


RE: Recovering lost source code when the code is running in memory - Larz60+ - Mar-30-2017

May I ask why you are so compelled to rewrite something that's already written quite well in the first place?


RE: Recovering lost source code when the code is running in memory - Skaperen - Mar-30-2017

(Mar-30-2017, 02:03 AM)Larz60+ Wrote: May I ask why you are so compelled to rewrite something that's already written quite well in the first place?

python makes it easier to add features.

i started, tonight, working on a new feature to make the my e command and my keep command (part of a module now) have a configurable option to store the copies it makes in a specific directory.  it uses my pyconfig function to get the directory name from the config file.


RE: Recovering lost source code when the code is running in memory - teenspirit - Apr-13-2017

(Mar-30-2017, 02:03 AM)Larz60+ Wrote: May I ask why you are so compelled to rewrite something that's already written quite well in the first place?

That is always the point... If nononee ever rewrote something that is thought to be well written, we would all still be coding in Fortran or A(PL).


RE: Recovering lost source code when the code is running in memory - Larz60+ - Apr-13-2017

Quote:That is always the point... If nononee ever rewrote something that is thought to be well written, we would all still be coding in Fortran or A(PL).

I would agree you, but only to an extent.
When I work on my car, I don't first try and re-invent the lift.

The lift has worked well for what is does for many years.
That's not to say that is shouldn't be improved.

After 50 years of professional programming, I must say that I have seen
a lot of wasted time spent on attempting to re-write applications that are already
extremely good, instead of placing the effort on those that really need to be re-written.