Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Mising documentation for uos.stat()

    Scheduled Pinned Locked Moved LoPy
    16 Posts 5 Posters 4.2k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bmarkusB Offline
      bmarkus
      last edited by bmarkus

      One of the LoPy issues is the really poor documentation. There are lot of information missing or if it looks like documented in fact unusable. Not the only one but I faced recently the explanation uos.stat() return values :(

      Why the Hell I have to do reverse engineering to use a commercial product?

      https://docs.pycom.io/pycom_esp32/library/uos.html#uos.stat

      1 Reply Last reply Reply Quote 1
      • S Offline
        sakis
        last edited by

        Hello,

        This is standard micropython documentation and the returned values are actually documented in standard Python: https://docs.python.org/2/library/errno.html#module-errno

        Does that help?

        bmarkusB 1 Reply Last reply Reply Quote 0
        • bmarkusB Offline
          bmarkus @sakis
          last edited by bmarkus

          @sakis said in Mising documentation for uos.stat():

          Hello,

          This is standard micropython documentation and the returned values are actually documented in standard Python: https://docs.python.org/2/library/errno.html#module-errno

          Does that help?

          Why are you referring to the error codes?

          In the Pycom doc there is nothing about return values. Without describing return values for a function it is not a documentation. You can say 'It is the same as in cPython' but even in this case why to refer to an external documention in your own doc?

          As a developer, do you like to work with a product with useless documentation, unmet commitments, misleading brochures and product descriptions with missing features based on unstable beta hardware where even no any warranty that hw vendor will fix issues and no ETA it will ever work on acceptable level?
          As a hobby DIY constructor you can play with such board in the evening in your free time but no way to use it for a product.

          You can say it is up to the hw vendor which is probably true. But to release a product based on alpha unproven silicon with alpha fw is a bad decision op Pycom. During the last few month your documentation structure is still messy and nearly unusable. Yesterday I was looking for the documentation and at pycom.io site there are no single menu item for docs. You do not have to reinvent the wheel, just do what others are doing well. Not referring to big guns, but other KickStarters with similar products providing excellent docs.

          I'm really unhappy and fior sure will never buy any Pycom product and do not advice others to do it.

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sakis @bmarkus
            last edited by

            @bmarkus

            The Pycom doc parts that refer to MicroPython are not modified to allow future merging. Here's the original MicroPython doc of uos.stat: http://docs.micropython.org/en/latest/pyboard/library/uos.html#uos.stat. As you see, there's nothing there. That's what I meant by standard MicroPython documentation. Perhaps we should improve the documentation of that function in our docs.

            Without being the creator of MicroPython, I think that the fact that it is a port of Python 3 for microcontrollers means that the error codes of a function like stat must be the same (or at least close) to the error codes of standard Python. That's why I referred to Python's documentation.

            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.

            Sorry to hear about your disappointment. I hope that we can change your mind.

            L bmarkusB 2 Replies Last reply Reply Quote 0
            • L Offline
              livius @sakis
              last edited by livius

              @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 return touple without 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 ...

              think about people first, then computers

              1 Reply Last reply Reply Quote 0
              • bmarkusB Offline
                bmarkus @sakis
                last edited by

                @sakis said in Mising documentation for uos.stat():

                @bmarkus

                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.)?

                1 Reply Last reply Reply Quote 0
                • S Offline
                  sakis
                  last edited by

                  @bmarkus @livius

                  Fair points. We are planning to release an update to our documentation this week and documenting the return values of os.stat will be part of it.

                  1 Reply Last reply Reply Quote 0
                  • robert-hhR Offline
                    robert-hh
                    last edited by

                    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.

                    L 1 Reply Last reply Reply Quote 1
                    • L Offline
                      livius @robert-hh
                      last edited by

                      @robert-hh said in Mising documentation for uos.stat():

                      it work for you in that way?
                      like os.stat().ST_SIZE?

                      i must check this at home - i tested this previously and i remember that it does not know ST_SIZE

                      think about people first, then computers

                      1 Reply Last reply Reply Quote 0
                      • robert-hhR Offline
                        robert-hh
                        last edited by

                        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.

                        L 1 Reply Last reply Reply Quote 0
                        • L Offline
                          livius @robert-hh
                          last edited by

                          @robert-hh said in Mising documentation for uos.stat():

                          The symbolic indices are NOT set.

                          and that is the point

                          think about people first, then computers

                          1 Reply Last reply Reply Quote 0
                          • robert-hhR Offline
                            robert-hh
                            last edited by

                            This is a Micro, fighting for every byte for memory. Too many features make it unusable.

                            L 1 Reply Last reply Reply Quote 0
                            • L Offline
                              livius @robert-hh
                              last edited by

                              @robert-hh
                              you have right but without doc you do not know what are that numbers in touple
                              you can guess but not for sure

                              but as @sakis say it will change in this week

                              think about people first, then computers

                              1 Reply Last reply Reply Quote 0
                              • sorenS Offline
                                soren
                                last edited by

                                Couldn't agree more.

                                robert-hhR 1 Reply Last reply Reply Quote 0
                                • robert-hhR Offline
                                  robert-hh @soren
                                  last edited by

                                  @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.

                                  bmarkusB 1 Reply Last reply Reply Quote 0
                                  • bmarkusB Offline
                                    bmarkus @robert-hh
                                    last edited by

                                    @robert-hh said in Mising documentation for uos.stat():

                                    @soren @bmarkus I see this as a semi-commercial product.

                                    It is a commercial product range offered in form of development and OEM moduls.

                                    1 Reply Last reply Reply Quote 0

                                    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
                                    • 1 / 1
                                    • First post
                                      Last post

                                    Pycom on Twitter

                                    Pycom