HOWTO?? edit a library's example sketch?

I wrote an application-specific library with the following directory structure format:

.../libraries/
RocketTextLogo/
RocketTextLogo.h
RocketTextLogo.cpp
keywords.txt
examples/
drawLogo/
drawLogo.ino

drawLogo shows up in the menu as File -> Sketchbook -> libraries -> RocketTextLogo -> drawLogo as expected, and can be opened properly.

I need to edit the code in drawLogo.ino, so I load it into the IDE, and make my changes. When I try to save the sketch, I get a warning that "some files are read-only" - apparently because the IDE sees the sketch as an example, and therefore refuses to save the changes.

How can I update the code for the example, other than using an external editor which doesn't think the file is read-only - i.e., ANY other application on my system?

Open "File" then "Save As..."

select location OUTSIDE libraries or IDE expamples (e.g. select Desktop) then confirm

sketch will be saved

use another editor e.g. notepad++

Assuming you are running Windows - the file attributes are OS parameters. You need to change that using OS.
Notepad will have same issue.

Vaclav:
Assuming you are running Windows - the file attributes are OS parameters. You need to change that using OS.
Notepad will have same issue.

I always develop my libs and test code in notepad++ (win7/64) without a problem.
It is the IDE that forbids saving files AFAIK.

K5CZ:
Open "File" then "Save As..."

select location OUTSIDE libraries or IDE expamples (e.g. select Desktop) then confirm

sketch will be saved

The point is I'm trying to update the example for a library - so the location to save it is in the library example directory, not somewhere else on the computer.

Vaclav:
Assuming you are running Windows - the file attributes are OS parameters. You need to change that using OS.
Notepad will have same issue.

When I first came across this problem I thought it was read-only attributes due to the O/S - and I ended up changing ownership and permissions on the entire directory tree, trying to get the "read only" checkbox to not be on/grayed - and never got it to work as expected.

It was after spending more than half a day fighting with winDoze over file attributes that I discovered that no other applications thought the sketches were read-only - it's an "attribute" set by the IDE. (Somewhere in one of the library tutorials I saw something about examples being opened as read-only...)

From what I've seen, and the comments here, it looks like the only answer is to edit example sketches outside of the Arduino IDE - which brings its own set of problems - no syntax coloring or keywords.txt support, formatting issues, etc.

From what I've seen, and the comments here, it looks like the only answer is to edit example sketches outside of the Arduino IDE - which brings its own set of problems - no syntax coloring or keywords.txt support, formatting issues, etc.

That's why I use notepad++. - http://notepad-plus-plus.org/ -

  • The TextFX plugin do re-indentation, strip trailing spaces, remove blank lines etc

It has other plugins e.g. to compare files, a sketch or a .h file and its previous version to see your changes in detail.