Add mkdir, cd, and more, refactor.

This commit is contained in:
Brad Nelson
2022-09-05 21:25:46 -07:00
parent 0dbe262abf
commit 234d85bf71
6 changed files with 95 additions and 33 deletions

View File

@ -53,6 +53,16 @@ forth definitions internals
again
;
DEFINED? read-dir [IF]
: ls ( "path" -- )
bl parse open-dir throw { dh } begin
dh read-dir dup 0= if
2drop dh close-dir throw exit
then type cr
again
;
[THEN]
internals definitions
( Leave some room for growth of starting system. )
0 value saving-base

View File

@ -307,6 +307,17 @@ e: check-float-opcodes
out: FSQRT
;e
e: check-files-dir
out: READ-DIR
out: CLOSE-DIR
out: OPEN-DIR
;e
e: check-files-dir-reverse
out: OPEN-DIR
out: CLOSE-DIR
;e
e: check-files
out: NON-BLOCK
out: FILE-SIZE
@ -409,6 +420,12 @@ e: check-snapshots
out: remember
out: restore
out: save
;e
e: check-fileops
DEFINED? open-dir [IF]
out: ls
[THEN]
out: cat
out: touch
out: rm
@ -479,6 +496,7 @@ e: check-filetools
check-blocks
check-imports
check-snapshots
check-fileops
out: streams
out: ms
check-tasks
@ -568,8 +586,13 @@ e: test-posix-forth-namespace
out: termios
check-allocation
out: ok
out: pwd
out: rmdir
out: mkdir
out: cd
out: ms-ticks
out: ms
check-files-dir
check-files
out: default-key
out: default-type
@ -586,6 +609,10 @@ e: test-esp32-forth-voclist
internals ' ansi voclist-from
out: ansi
out: registers
out: ansi
out: editor
out: streams
out: tasks
out: oled
out: bluetooth
out: rtos
@ -601,10 +628,6 @@ e: test-esp32-forth-voclist
out: WiFi
out: Wire
out: ESP
out: ansi
out: editor
out: streams
out: tasks
out: structures
out: internalized
out: internals
@ -637,10 +660,30 @@ e: check-esp32-builtins
out: MS-TICKS
out: TERMINATE
check-files-reverse
check-files-dir-reverse
out: dacWrite
out: MDNS.begin
;e
e: check-esp32-bindings
out: oled
out: bluetooth
out: rtos
out: rmt
out: interrupts
out: sockets
out: Serial
out: ledc
out: SPIFFS
out: spi_flash
out: SD_MMC
out: SD
out: WiFi
out: Wire
out: ESP
out: read-dir
;e
e: test-esp32-forth-namespace
' forth list-from
out: FORTH
@ -657,23 +700,9 @@ e: test-esp32-forth-namespace
out: web-interface
out: httpd
check-esp32-platform
out: oled
out: bluetooth
out: rtos
out: rmt
out: interrupts
out: sockets
out: Serial
out: ledc
out: SPIFFS
out: spi_flash
out: SD_MMC
out: SD
out: WiFi
out: Wire
out: ESP
check-filetools
check-phase2
check-esp32-bindings
check-allocation
check-phase1
check-esp32-builtins