Black Lives Matter - Action and Equality.
0

Don't want Circuitpy folder to show up
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Don't want Circuitpy folder to show up

by sbarton on Wed May 13, 2020 10:15 pm

Is there a way to not have the Circuitpy folder or its contents show up when plugged into a computer while still allowing the code to run? Basically I don't want the code to be easily accessible to read or write unless say a button is pressed.

sbarton
 
Posts: 11
Joined: Fri May 08, 2020 1:40 pm

Re: Don't want Circuitpy folder to show up

by dastels on Thu May 14, 2020 10:15 am

I don't believe there is... it's so central to how CircuitPython works. There are usually OS settings to avoid auto-mounting USB drives, but that wouldn't be under the control of the CP board.

Dave

dastels
 
Posts: 2473
Joined: Tue Oct 20, 2015 3:22 pm

Re: Don't want Circuitpy folder to show up

by sbarton on Thu May 14, 2020 11:18 am

OK, thanks. I was able to make it read only unless you push a button, but I really need it to not be able to see the contents of the directory (or not see the directory at all).

sbarton
 
Posts: 11
Joined: Fri May 08, 2020 1:40 pm

Re: Don't want Circuitpy folder to show up

by tannewt on Thu May 14, 2020 2:24 pm

CircuitPython is designed to be open and hackable. We're not going to spend the time to make an easy way to obscure the code.

We would review and likely merge code to do so though. It's just not a priority for us.

tannewt
 
Posts: 1644
Joined: Thu Oct 06, 2016 8:48 pm

Re: Don't want Circuitpy folder to show up

by kevinjwalters on Sat May 16, 2020 1:33 pm

There might have been a request for this in the past for classroom use as a measure to stop students affecting the working (!) example code until it's time to play with it.

I've not tried it myself but wouldn't the example in CircuitPython Essentials: CircuitPython Storage which shows how to use storage.remount() in boot.py do this because it inhibits writes (and reads) from the host by disabling CIRCUITPY when the device has r/w access to storage?

kevinjwalters
 
Posts: 576
Joined: Sun Oct 01, 2017 3:15 pm

Re: Don't want Circuitpy folder to show up

by dastels on Sat May 16, 2020 5:37 pm

I believe that leaves the CIRCUITPY drive readable by the computer, just not writable.

dastels
 
Posts: 2473
Joined: Tue Oct 20, 2015 3:22 pm

Re: Don't want Circuitpy folder to show up

by sbarton on Thu May 21, 2020 11:55 am

kevinjwalters wrote:There might have been a request for this in the past for classroom use as a measure to stop students affecting the working (!) example code until it's time to play with it.

I've not tried it myself but wouldn't the example in CircuitPython Essentials: CircuitPython Storage which shows how to use storage.remount() in boot.py do this because it inhibits writes (and reads) from the host by disabling CIRCUITPY when the device has r/w access to storage?



This is what I'm doing to make it Read only. You can still read the contents (which I don't want), but you can't write to it.

sbarton
 
Posts: 11
Joined: Fri May 08, 2020 1:40 pm

Re: Don't want Circuitpy folder to show up

by kevinjwalters on Thu May 21, 2020 12:29 pm

You might want to see what some of the gems from Microsoft's "golden" MS-DOS era can do for you. The attrib command (from 3.x) lingers on. For the GUI version, right click on the file for Properties in Explorer on Windows, look for Attributes and you can see if it does anything useful for you.

kevinjwalters
 
Posts: 576
Joined: Sun Oct 01, 2017 3:15 pm

Please be positive and constructive with your questions and comments.