scientifichackers / ampy

MicroPython Tool - Utility to interact with a MicroPython board over a serial connection.
MIT License
720 stars 157 forks source link

print filesizes with ls command #35

Closed kanalizator closed 6 years ago

kanalizator commented 6 years ago

Hello, thanks for this wonderful utility. Only thing I am missing is file size info for ls command - it would be the easiest check if the file is same as on my PC. So i suggest adding something like -l parameter to show more about files, than just names.

Thanks.

ladyada commented 6 years ago

@tdicola next tidyday, implement this with an -l parameter as suggested (to mimic "ls -l")

tdicola commented 6 years ago

This is implemented now in the latest master branch code. Note that MicroPython doesn't calculate the size of directories and there's no way to detect a file from directory so they'll show as 0 bytes.

tony-imac:mpy tony$ ampy ls -l
test.txt - 34 bytes
test2.txt - 35 bytes
test - 0 bytes
.fseventsd - 0 bytes
lib - 0 bytes
Windows 7 Driver - 0 bytes
.metadata_never_index - 0 bytes
.Trashes - 0 bytes
boot_out.txt - 80 bytes
README.txt - 2103 bytes