How does one get a listing of the subdirectories of a directory? I can
see, in Chapter 21 of Steele, how to do many related things, but can't
figure this one out :-((
Thanks in advance
--
Forrest W. Young email: ·······@unc.edu
Professor Emeritus web: forrest.psych.unc.edu
University of North Carolina home: 1-412-767-9591
Chapel Hill, NC 27599 cell: 1-412-916-3091
you use the directory function and give it a wildcard which matches the
directories you want and tell it to return directories and not to return files.
given,
? (logical-pathname-translations "home")
((#4P"home:**;*.*" ··············@paz:MCL 4.3.1:**:*.*"))
? (pprint (directory "home:*" :directories t :files nil))
(··············@paz:MCL 4.3.1:dir:" ··············@paz:MCL 4.3.1:Examples:"
··············@paz:MCL 4.3.1:Interface Tools:"
··············@paz:MCL 4.3.1:Library:"
··············@paz:MCL 4.3.1:Patches 4.3.1:")
or
? (pprint (directory "home:*;*;" :directories t :files nil))
(··············@paz:MCL 4.3.1:Examples:Binhex:"
··············@paz:MCL 4.3.1:Examples:FF Examples:"
··············@paz:MCL 4.3.1:Examples:NotInROM:"
··············@paz:MCL 4.3.1:Examples:series:"
··············@paz:MCL 4.3.1:Library:Inspector Folder:"
··············@paz:MCL 4.3.1:Library:Interfaces:")
?
or
? (pprint (directory "home:**;*" :directories t :files nil))
(··············@paz:MCL 4.3.1:dir:"
··············@paz:MCL 4.3.1:Examples:"
··············@paz:MCL 4.3.1:Examples:Binhex:"
··············@paz:MCL 4.3.1:Examples:FF Examples:"
··············@paz:MCL 4.3.1:Examples:NotInROM:"
··············@paz:MCL 4.3.1:Examples:series:"
··············@paz:MCL 4.3.1:Interface Tools:"
··············@paz:MCL 4.3.1:Library:"
··············@paz:MCL 4.3.1:Library:Inspector Folder:"
··············@paz:MCL 4.3.1:Library:Inspector Folder:PPC:"
··············@paz:MCL 4.3.1:Library:Interfaces:"
··············@paz:MCL 4.3.1:Library:Interfaces:index:"
··············@paz:MCL 4.3.1:Patches 4.3.1:")
?
i'm not sure if the terminating ";" matters.
Forrest Young wrote:
>
> How does one get a listing of the subdirectories of a directory? I can
> see, in Chapter 21 of Steele, how to do many related things, but can't
> figure this one out :-((
>
> Thanks in advance
>
> --
> Forrest W. Young email: ·······@unc.edu
> Professor Emeritus web: forrest.psych.unc.edu
> University of North Carolina home: 1-412-767-9591
> Chapel Hill, NC 27599 cell: 1-412-916-3091