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).

Arguments:

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

Refinements:

/l - Line of info format

/f - Files only

/d - Dirs only

/r - Recursive

/i

indent

See also:

change-dir   make-dir   what-dir   read  

Description

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.

list-dir

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 %trash.me]


  TOC < Back Next > REBOL.com - WIP Wiki Feedback Admin