Mising documentation for uos.stat()
-
@sakis
I see that you mention that you are not creator of micropython...
but in normal python os.stat return object
class os.stat_result
but here it returntouplewithout any description
e.g.:>>> os.stat('/sd') (16384, 0, 0, 0, 0, 0, 0, 12873600, 12873600, 12873600)what are that values?
i need to know how big is sd card, free space ... -
@sakis said in Mising documentation for uos.stat():
About your rest points, I agree that a docs link should be added to pycom.io. And we are trying hard to improve both our documentation and our firmware.
After 21 days Pycom doc looks the same at https://docs.pycom.io/pycom_esp32/library/uos.html
saying only
Get the status of a file or directory.
So, question is still valid, what is the return value? It is a question related to your own commercial product, not related to chip vendor, LoRa Alliance, CIA, KGB, ...
What is about making a product usable for its customers and provide documentation? How do you expect to use it (expecting we get some free RAM and stable functions instead of changing it every week, introducing new bugs, etc.)?
-
-
The returned tuple has the structure defined for Python3 os.stat(). Only not all values are populated. useful values are:
ST_MODE
ST_SIZE
ST_ATIME which is teh same as ST_MTIME and ST_CTIME
The other values are set to zero, since they do not apply in the given environment, but the full structure is returned for compatibility.
No reason to complain. If there is not special documentation, assume Python compliance as a plausible choice. -
@robert-hh said in Mising documentation for uos.stat():
it work for you in that way?
likeos.stat().ST_SIZE?i must check this at home - i tested this previously and i remember that it does not know ST_SIZE
-
No, not that way. os.stat() return a 10-tuple, and the 7th, os_stat()[6], is the size. The symbolic indices are NOT set.
-
@robert-hh said in Mising documentation for uos.stat():
The symbolic indices are NOT set.
and that is the point
-
This is a Micro, fighting for every byte for memory. Too many features make it unusable.
-
@robert-hh
you have right but without doc you do not know what are that numbers in touple
you can guess but not for surebut as @sakis say it will change in this week
-
Couldn't agree more.
-
@soren @bmarkus I see this as a semi-commercial product.
The documentation is not complete and sometimes wrong, since it was taken from the micropython.org port. Then some extension were made, but no-one seemed to have checked, whether everything fits. There seem to be a person now in Pycom.io dedicated to documentation, but maybe I'm wrong.
But if you like, you can contribute to the documentation. Sometimes, PRs to the documentation are noticed. In case of uos.stat(), the documentation is present. -
@robert-hh said in Mising documentation for uos.stat():
It is a commercial product range offered in form of development and OEM moduls.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login