Version: 4.0.2
1.10 Working with Files and Directories: dir.ss
The teachpack provides structures and operations for working with files and directories:
| |||||
name : string? | |||||
dirs : (list-of dir?) | |||||
files : (list-of file?) |
| |||||
name : string? | |||||
content : (list-of char?) |
(create-dir path) → dir? |
path : string? |
Turns the directory found at path on your computer into an instance of dir?.
Sample: Set teachpack to <code>dir.ss</code> and click RUN:
> (create-dir ".") |
'|.| |
empty |
empty))))))) |
Using “.” usually means the directory in which your program is located. In this case, the directory contains no sub-directories and six files.
Note: Softlinks are always treated as if they were empty files.