I worte the following script to list all the directories. It doesn't work, why? Code: elenco: copy [ ] funz_cerca: func [ /local a ] [ a: read %. foreach file a [ if dir? file [ append elenco (to-string file) change-dir file funz_cerca ] ] ] funz_cerca write %listadir.txt elenco
EUREKA!!! I resolved. Code: elenco: copy [ ] funz_cerca: func [ /local a ] [ a: read %. foreach file a [ if dir? file [ append elenco (to-string file) change-dir file funz_cerca change-dir %.. ] ] ] funz_cerca write %listadir.txt elenco
You do not seem to be specifying the folder name in a way REBOL is happy with. This should work: Code: elenco: copy [ ] funz_cerca: func [curr-dir [file!] /local a ] [ a: read curr-dir foreach file a [ if dir? file [ print file append elenco (to-string file) attempt [funz_cerca join curr-dir file] ] ] ] funz_cerca what-dir probe elenco