Read Only Example Sketched!

I don't know if this is just a grumble, or if it is something that is already being addressed.

I have wasted a load of time today working with Example Setches.
They are read only. Fine!

But when I did a save-as giving them a new name, the new file was an exact copy of the original example sketch without any changes I had made, and it too was Read Only.

And I didn't get any warning messages.
Maybe I am a slow learner, but it was SO frustrating!

'tis been that way as long as I can remember. Just open the example, open a "new" sketch, use ctrl-a in example and ctrl-c to copy then click in in new-sketch, ctrl-a to highlight what to over-write, ctrl-v to paste. Close example.

The examples are read only so someone doesn't accidently change them and have to reinstall to get they back to the default.

I have (in Windows) a directory under "My Documents" Named "Arduino" I save all my sketches there.

For the purposes of the related discussion here, it is important to understand there are/has been two types of "read-only" sketches in Arduino IDE.

  • Location-based: Arduino IDE 1.x treats sketches as "read-only" if they are under a library (examples).
  • File attribute based: A file may be made universally read-only at a file system level.

Even though the two types of "read-only" are presented in the same manner by the Arduino IDE 1.x interface, Arduino IDE (1.x and 2.x) does not ever set the read-only file attribute. So if you are finding that your sketches have the read-only file attribute, that happened independently from Arduino IDE and has no correlation to a sketch having been treated as "read-only" based on location.

Another thing to note is that Arduino IDE 2.x does not currently have this location-based "read-only" system for library examples. It opens examples as a new sketch instead of opening the sketch in place, so examples are treated the same as creating a sketch via File > New. The location-based "read-only" system for library examples is exclusive to Arduino IDE 1.x (though that might eventually change). It appears @timeagainroy is using Arduino IDE 2.x, but I mention the Arduino IDE 1.x behavior because some of the discussion here is assuming that behavior.

Some other users have reported the problem of the read-only attribute being set in sketches. Their investigation indicates this is caused by Windows update rather than Arduino IDE setting the file attributes:

This bug in Arduino IDE 2.x is being tracked by the developers here:

If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.

The last bit about it being worked on is good news.
It is not a behaviour one would expect - whatever the cause.

However, I am really annoyed with myself for ignoring the (now obvious in retrospect) signs that something odd was going on. (I had to keep resetting the baud rate - but didn’t find out why!)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.