Clearing the OSX extended files off of microcontroller flash drives #Apple #Catalina #AdafruitForums
Adafruit forums user aaaidan ran into an issue familiar to those using OSX (Catalina) with flash drives, including microcontroller development boards appearing as flash drives.
I found I was running out of space on my Trinket M0 super easily, and I wanted to share a tip for Mac OS that helped save me a lot of space (possibly dozens of KB on my very modest program). This is beyond clearing out needless visible files and hidden files (e.g. dotfiles).
While adafruit have done a really good job hinting to operating systems that they shouldn’t write metadata to the drive (no_log etc), that doesn’t stop Mac OS copying “extended attributes” on files if you copy-paste or drag them into the drive in the Finder. (This is explained by Adafruit here under “Copy Files on Mac OSX Without Creating Hidden Files”.)
For me, a newcomer to CircuitPython, these attributes were included when I copied the default main.py program, and some adafruit SPI library files into the lib folder. A total of 5 files (~8.5KB of code). But it wouldn’t fit in the 48KB drive, even after I cleared out all the junk I could find. (And emptied the trash ;P)
After a bit of research and learning about these extended attributes, I cleared them manually on every file. I was very surprised to see how much space it freed up on the drive. I went from having 0% free to about 50% free, which is over 20kb – enough for a decent main.py.
If you are having the same issues, see the forum post for a shell script that will clean up the extended file attributes, freeing up much appreciated space.
8-6-2021 (August 6, 2021) is the Snakiest day of the year and it’s also this year’s CircuitPython Day! The day highlights all things CircuitPython and Python on Hardware. See you there!
Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.