Hack to remove read-only flag from libraries

So this is a 10 year old thread relating to an old version of the IDE (v1.5.x) and relating to the Examples sketches. Are you really using an IDE version that old?

Even in that thread, Grumpy Mike stated as I will do one more time, that the Arduino IDE does NOT impose a read-only state on the libraries folder. The examples are understandably protected from being altered, but the programmer is free to do a 'Save As' and make and edit their own copy of the example sketch.

Unlikely, but what version of the IDE are you using exactly?

Ok, so this is your Arduino libraries folder. Is your Sketchbook folder therefore:

..Documents\Arduino\ ?

Could I ask whether you are having the same problem when editing the file with a simple editor such as Notepad?

Also, right-click the following folders:

..Documents\Arduino\
..Documents\Arduino\libraries\

Have a look at the permissions. What are they set at?
Could you post screenshots?

I appreciate that you are feeling frustrated, but AFAIK, in terms of sketch and library development, nothing is 'forbidden' by the Arduino IDE. How do you imagine other developers manage to develop, test and contribute their libraries? However, you cannot overwrite the examples for obvious reasons. You should, however be able to create a new folder in libraries an edit something within that folder.

You create the examples as would anyone do using your library : outside the library. Once they work you integrate them inside the library (move the sketch folder there).

It makes total sense that a user could not by mistake (examples are readily available to open) mess with your hard work and any library content. This is a very sound precaution in my view, not a stupid idea.

Yes.

  • In your (or any) library root folder, just create an empty text file without extension, simply called development
  • You can now edit and save example sketches, yourLibrary.h and yourLibrary.cpp files
  • Remember to delete (or rename) development to bring back read-only status for the library.

Yes, on Windows 10, the library folder is RO

Being a programmer with years of experience, you must realize that your default userID in windows (non-domain) gives you the authority to quickly change the folder and all subordinate directories and files as RO and make them R/W.

In my Win-11 and Linux Mint environments, I can use "./filename.h" or I can use "filename.h" with my own/3rdParty libs in the sketch folder.

My recommendation for any serious project is after rough prototyping, libraries should be placed in the sketch folder, #includes edited, and a test compile completed. At thus point, a single Zip can be made of your complete project, a snapshot in time. Regular Zips ensure restore points.

Of course, you are likely using source code management, so this all sounds rather elementary; new users however find this tip helpful.

IMO, you are being rather unjust in your assessment; In my many years of managing a Fortune 100 programming JAVA staff, I have witness far worst... far, far worst.

yuck!
Any serious project and/or decent s/w developer would use source control tools not goofy zip files and/or snapshots.
IMO, these days git and a cloud repository like github or bitbucket/attlassian is the way to go.
github being optimal since libraries there can be integrated into the IDE library manager.

using git is a real time saver and productivity booster especially when using it with tools that integrate directly into the OS file manager (tools for this are available on linux and Windows)
git is far superior over other SCM tools in its ability to handle branches and merges.

I put all my Arduino libraries including those under development under
{sketchbook}/libraries/library-name

I ALWAYS use source control tools (have since the early 80s)
These days it is git. git is nice because it is all local and if desired you can sync the commits up to the cloud repository.
I use both bitbucket and github. The only reason I use bitbucket/attlassian is github does not allow non public repositories for non paid accounts.

IMO, doing s/w development without s/w source control tools is plain silly.

--- bill

Correction: the file must be named .development (note the . at the start of the file name.

This flag file is documented in the Arduino Library Specification:

https://arduino.github.io/arduino-cli/latest/library-specification/#development-flag-file

1 Like

Looks like the problem persist in 1.8 version.

I have empty sketch in my library so the Arduino IDE shows them. It is only way how to see & edit them in Arduino IDE. The problem is the Arduino IDE read-only stupid behaviour.

Just try to create your own library and you will face the same problem.

You are mistaken a little. Folder attribute is more complicated then you think - it is not RO.

Someone from Arduino IDE comes with downgrade - forbit local paths. You can use "./filename.h" but you cannot use "./xxxxx/filename.h" and the like. Every clever programmer will have library in separate folder. One library for zillions sketchs.

Moderator edit: rude language removed.

Git still not fix the Arduino IDE read-only fail.

Are you from the official arduino team? Is it possible to get the forums name of Arduino developer who make this restriction?

BTW I also tried this development flag before I created this post. The file itselfs do not work. Try it.

Moderator edit: rude language removed.

No. I would rather they do productive work than waste time and energy on this toxic and unnecessarily convoluted thread.

I would try "it", but I can't understand what "it" is. The problem is you have focused all your energy into insulting rants instead of clearly communicating what you are trying to accomplish.

Mod edit:

you have focused all your energy into insulting rants

Most if not all the insulting rants removed, so if this comment does not make sense to future readers it's because I cleaned up this topic.

1 Like

If you want to make a change in your own library, you need to copy it somewhele else within Arduino library folder. Create new sketch, make changes, built it / test it ... and then copy it back to Arduino library folder.

Obviously. I was just referring to s/w development tools related to source control.

Seriously dude, you need to chill and tone things down otherwise you risk getting a timeout or having people just ignore you.

With respect to your permissions issues.
It sounds like you may be having a problem of your own invention.

I have never had the issue you are having and others don't seem to be having this issue either.

I also have not had any issue with including header files in subdirectories from my libraries (I use subdirectories for header files in my libraries) and have not had any issues using them in any IDE release long before 1.0 (way back to like 2008) all way to present version 2.0.3

And after all your rants in this thread, I'm still not sure where you placing your library and files and what specific problem you are really having as you haven't provided any specific example code that is failing nor specific information as to the EXACT place where you are storing things and where your sketchbook directory is located.

I also can't tell if you are even aware that there are multiple libraries directories where the IDE will look for libraries and that your personal libraries should be placed under the libraries directory under your sketchbook directory.
And depending on which IDE version you are using you may have to create the libraries directory under the sketchbook directory yourself in which case you control the permissions.

--- bill

I don't do that, never have, and I doubt anybody else is doing that either.
I edit the my library files in place which is in a directory under
{sketchbook}/libraries/my-library-name

Where {sketchbook} is the sketchbook location in the Arduino IDE preferences.

As far as sketch code, that can be under examples under the library, or can be sketch code under {sketchbook}

--- bill

Are you editing them in Arduino IDE?

This is a completely false statement and has nothing to do with reality. I have several libraries of my own and have no problem editing them in the libraries folder in IDE versions 1.6 1.8 and 1.9. There is no read-only flag there.
It looks like you've come here solely to start a fight. Or the whole problem is that your Windows is configured incorrectly. The fact that you cannot fix it yourself for a programmer for several years is simply a shame.

Please stop insult the community and go to fix your errors yourself.

Are you editing them in Arduino IDE?

No.

But with this question you have changed the point of view already!
You stated before that the library folder has RO attribute. - It does not.

Mod edit:
Cleaned up.

Great. We are in Arduino forum, in Arduino IDE section ... and you are clever enought to not using Arduino IDE - like I am forced right now but some people here do not understand it.

Please, can you explain, why you not use Arduino IDE?