REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 3-Aug-2010 Edit History  

REBOL 3 Functions: list-dir

list-dir  path  /l  /f  /d  /r  /i  indent

Print contents of a directory (ls).


path [file! word! path! string! unset!] - Accepts %file, :variables, and just words (as dirs)


/l - Line of info format

/f - Files only

/d - Dirs only

/r - Recursive



See also:

change-dir   make-dir   what-dir   read  


Lists the files and directories of the specified path in a sorted multi-column output. If no path is specified, the directory specified in system/script/path is listed. Directory names are followed by a slash (/) in the output listing.


To obtain a block of files for use by your program, use the LOAD function. The example below returns a block that contains the names of all files and directories in the local directory.

files: load %./
print length? files
probe files
[%autos.txt %build-docs.r %bulk-modify.r %cgi.r %convert-orig.r %CVS/ %emit-html.r %eval-examples.r %fix-args.r %fred/ %funcs.r %helloworld.txt %merge-funcs.r %newfile.txt %notes.txt %public/ %replace.r %scan-doc.r %scan-titles.r %strip-title.r %test-file.txt]

  TOC < Back Next > - WIP Wiki Feedback Admin