Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
FileTools[ListDirectory] - display the contents of a directory
Calling Sequence
ListDirectory(dir, opt1, opt2, ...)
Parameters
dir
-
path to the directory to be displayed
opt1, opt2, ...
(optional) argument of the form option or option=value where option is one of all or returnonly
Description
The ListDirectory(dir) calling sequence returns the contents of the directory dir as a list.
ListDirectory accepts two optional arguments: all and returnonly.
all or all = true/false
By default ListDirectory does not display filenames that begin with ".". Specifying the all option makes ListDirectory consider these files as well.
returnonly = string
The string argument is used to select elements from the list of filenames. Only the filenames that match the pattern specified in the string are returned. Patterns of the form defined by StringTools[WildcardMatch] are used.
If dir does not exist, ListDirectory generates an error.
If dir is not a directory, ListDirectory generates an error.
For information on filenames, see file.
Examples
Error, (in listdir) directory does not exist
Error, (in isdir) file or directory does not exist
See Also
file, FileTools[Binary][Open], FileTools[IsDirectory], FileTools[Text][Open], IO_errors, StringTools[WildcardMatch]
Download Help Document