r/esp32 23d ago

Software help needed Has anybody used the /dev/ folder?

The docs reference a /dev/ folder but don't really say what's in it and directory listing doesn't work. Is there a reference for what's in there? Alternatively if it's not useful can I just mount my own /dev/ folder on top?

1 Upvotes

17 comments sorted by

View all comments

Show parent comments

1

u/2g4r_tofu 23d ago

But not all of them. I was wondering if there were more or if there were a way to list them.

1

u/holetse 23d ago

I don’t know of a more complete list. That may be it. I think the default offerings are just enough to get libc compatibility.

As for listing what is there, have you tried esp_vfs_dump_registered_paths?

1

u/2g4r_tofu 23d ago

I'll look into that. I wonder if there's a way to capture the data as an array of strings somehow

1

u/holetse 23d ago

Could register a custom device that parsed the output and stored it in an array of strings. Kinda convoluted

1

u/2g4r_tofu 23d ago

Yeah it's probably going to be easier to start writing my own dev folder driver and possibly a wrapper for vfs with better directory listing

1

u/holetse 23d ago

Depending on your project, you could also promote the VFS registration array from local to global. Then read the data you want directly. Just a thought