Added a new interface lfs_file_getattr to get the corresponding file attributes through lfs_file. This interface is similar to lfs_getattr, but lfs_file_getattr replaces path with lfs_file.
Implemented the corresponding test case in test_attrs.toml.
The main logic of the test:
Create a file and get its attributes (it should return LFS_ERR_NOATTR at this time)
Set its attributes and then get the attributes and compare the attributes
After passing make test, the results are all passed
This change comes from https://github.com/littlefs-project/littlefs/pull/1045, which splits lfs_file_getattr and lfs_file_setattr. At the same time, the logic of lfs_file_getattr is optimized.
The main logic of the test:
After passing
make test
, the results are all passed