saving changes to sketches

On my windows computer, Arduino folders are marked "read only" and apparently that status can't be changed permanently. This prevents saving changes to a sketch. Maybe this is a stupid question, but how do I save changes to a sketch, short of copying it into Notepad, closing the Arduino sketch, and saving the changes on top of the old sketch inside its folder?

Where are you trying to save the programs ?

Mine go into C:\Users\Bob\Documents\Arduino which is set in File/Preferences

From within the IDE and with the code you want to save in the source code window:

  1. Press Ctrl-A to highlight the code.
  2. Press Ctrl-C to copy the source code to the copy buffer.
  3. Press Ctrl-N to create a new source code window
  4. Press Ctrl-A to highlight the framework code in the code window
  5. Press Delete to remove the framework code.
  6. Press Ctrl-C to copy the code from the copy buffer to the source code window
  7. Press Ctrl-S to save the code using the file name of your choice.

I came to the conclusion early on that the IDE did not want me to save anything with the same filename so I append a version number at the end of the filename and increment it before every save. Never had any problems since , either with keeping track of changes or telling sketches apart. Sometimes I put an abbreviation at the end of the filename that denotes the change to that version.

The Arduino IDE seems to treat "example" sketches within a library as read-only but I've never had a problem overwriting one of my own sketches in the Arduino directory. I also add version numbers on the end of the filename and increment them when I get a new piece of a sketch working.


OK. The answer I was looking for appears to be the fact that you can't re-save change to sketches when they are saved in the \examples folder. I was putting all my new sketches in that folder. However, this is not a problem for sketches saved in the \arduino folder. Problem solved. Thanks!

Hi, thank you for this topic - I had the same problem although reading through this, I have now moved "MyWork" to the "Arduino" folder and I can over-write as required when saving. Good Post Thanks D6