Objective
The program runs inside a folder that already contains the files of the test case. path.stat() returns information about a file, and st_size is its size in bytes. For a folder you must add up the size of all the files it contains, including those in subfolders.
Instructions
- Read the name of a folder inside the current folder.
- Show
Total size: n byteswith the sum of the sizes of all the files inside it, at any depth.
Example. With datos/a.txt (4 bytes) and datos/sub/b.txt (10 bytes), the input datos produces Total size: 14 bytes.
datos
Total size: 14 bytes
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise