I am using uPython on a STM32F405 using a modified pyboard build. I have a 128Mb SPI external flash connected. i am able to format it for FAT and can read and write files with no problems.
But I cannot get the size of a file on the flash. I have been logging data successfully. It's a large file and I can read the first part of the file using uos.read(1000). The command, os.listdir('/fc') correctly lists all the files on the flash. But I can't figure out how to get the size of the files.
any suggestions?
How to get file size
Re: How to get file size
os.stat()
Re: How to get file size
Yes, that works. But the numbers returned are not documented.
Re: How to get file size
They are documented with Python. But you have just to look at the order of the return values. Symbolic names for the fields are not provided.
os.stat(name)[6] is the file size.
os.stat(name)[6] is the file size.
Re: How to get file size
Works for me.
Thanks!
Thanks!