Idle does not save files

Developing code for raspberry pi zero on idle, I have a problem. For some reason idle no longer saves my file on shutdown as it used to do, so all my work is lost.
How can I cure this problem and get back to work.?strong text

I have to ask the obvious, are doing a file “save as” before shutting down?

Yes of course. And idle won’t shut down without a save. But when later fired up the file is not there.

Is this on a Pi or on a PC?
And where are you saving the file to?
Local storage or to the cloud etc?

As I said I am working on raspberry pi zero. After you have created a file on the idle editor a save is required before the code can be run. This save stores the new file as usual during the session. But after a shutdown only the files from months ago (before this fault appeared) remain and can be run or edited. The new files from the most recent sessions are missing.

Ok, the way it was worded “Developing code for raspberry pi zero on idle” had me wondering. I often write and edit python code on my PC, then test run it on a Pi latter on.
This a strange one. Next time you save a file, pay attention to where its being saved, you may have already done this, if so just ignore. But maybe its not saving where you think it is?
About the only other thing I can think of is maybe that SD card is corrupt or defective in some way? I copy files I don’t want to have to do all over again to a thumb drive, just in case that Pi refuses to boot up or something.

Update: my new files are not saved On shutdown when I work at the command line (terminal window) either, same as if I work in idle
I’m thinking this must indeed be a corrupt SD card.
Any other views?

I don’t have any other suggestions. Very strange issue that’s for sure.
Do you have a spare SD Card to try?

No. I’ll have to buy a new NOOBS SD card and start over. This time I’ll back it up as I should have done before.

You could just buy a card locally and image it with Raspbian yourself. The Pi foundation has a tool to do it, it’s linked to on the Raspbian download page.

Many thanks for your kind help.

If your current card is just corrupt, and not actually defective / damaged, reimaging it should fix the issue. Assuming its a corrupt OS that’s doing it.
If the card is defective I would think the imaging utility would flag it.

OK I’ll give it a try.