espressif/esp-idf

Add support for attributes in VFS (IDFGH-13326)

josesimoes opened this issue · 2 comments

Is your feature request related to a problem?

Currently virtual file system doesn't provide support for attributes, which is something rather "basic" in a file system.

Describe the solution you'd like.

This doesn't need to be anything fancy, simple ones like hidden, read-only, system would be quite enough.
All file systems that VFS tapps into offer this: FatFS, littlefs, SPIFFS.

Describe alternatives you've considered.

No response

Additional context.

Stumbled into this when making the migration from SPIFFs to littlefs for the flash storage in .NET nanoFramework nanoframework/nf-interpreter#2911.

Already discussed it with the author of littlefs for ESP extension. Please see issue here joltwallet/esp_littlefs#196.
It seems that there is path forward, still I believe it would be nice to have a couple of API to get and set attributes.

igrr commented

@josesimoes what would be the equivalent API you would use on a POSIX platform for this purpose?

I suppose the more suitable one would be chmod, right?
Still, hidden files would be missing because the current implementation lacks support for . started filenames, as stated in the docs.

I would suggest a more generic approach, such as providing setattr and getattr that accepts (or returns) an uint32 and then it's up to the file system to store and retrieve that number. It's up to the application layer to use as it sees fit.