|
7 | 7 | * `--listports`: List available USB ports
|
8 | 8 | * `--port /dev/tty`: Specify which port to connect. Required for the options below.
|
9 | 9 | * `--listfiles`: List files in the board
|
| 10 | +* `--ilistfiles`: Same as `--listfiles` but with additional information (size, inodes, folder/file, etc...) |
10 | 11 | * `--executestring "print('watch out for string escaping')”`: Evaluate string
|
11 | 12 | * `--executefile filename.py`: Run file from the disk
|
12 | 13 | * `--putfile fileA.py fileB.py`: Upload `fileA.py` from the disk to board renaming it to `fileB.py`
|
@@ -49,6 +50,33 @@ files at "/" [
|
49 | 50 | ]
|
50 | 51 | ```
|
51 | 52 |
|
| 53 | +### Listing files and folders in the board |
| 54 | + |
| 55 | +AS explained on the [documentation](https://docs.micropython.org/en/v1.9.2/pyboard/library/uos.html#uos.ilistdir), the second element on the array is the file type: |
| 56 | + |
| 57 | +> 0x4000 for directories and 0x8000 for regular files |
| 58 | +
|
| 59 | +``` |
| 60 | +$ node cli.js --verbose --port /dev/ttyACM0 --ilistfiles |
| 61 | +VERBOSE |
| 62 | +executing command: |
| 63 | +command --ilistfiles |
| 64 | +arguments [] |
| 65 | +port /dev/ttyACM0 |
| 66 | +files at "/" [ |
| 67 | + [ 'boot.py', 32768, 0, 1714 ], |
| 68 | + [ '.fseventsd', 16384, 0, 0 ], |
| 69 | + [ 'testy.py', 32768, 0, 78 ], |
| 70 | + [ 'file.py', 32768, 0, 929 ], |
| 71 | + [ 'yolo', 16384, 0, 0 ], |
| 72 | + [ 'lib', 16384, 0, 0 ], |
| 73 | + [ '.Trashes', 16384, 0, 0 ], |
| 74 | + [ 'otroteste.py', 32768, 0, 929 ], |
| 75 | + [ 'turing_machine.py', 32768, 0, 929 ] |
| 76 | +] |
| 77 | +command executed --ilistfiles |
| 78 | +``` |
| 79 | + |
52 | 80 | ### Evaluating a string
|
53 | 81 |
|
54 | 82 | ```
|
@@ -207,5 +235,5 @@ port /dev/ttyACM0
|
207 | 235 | 98%
|
208 | 236 | 99%
|
209 | 237 | undefined
|
210 |
| -command executed --putfile |
| 238 | +command executed --putfile |
211 | 239 | ```
|
0 commit comments