Introduction
This example shows how to use the builtin Iguana file APIs to read the files in a directory, and then to iterate through the files making a list containing various file attributes.
If you have any questions please contact us at support@interfaceware.com.
Using the Code [top]
- Import the Read a directory channel from the Builtin: Iguana Files repository
- Experiment with the code to find out how it works
- Adapt the code to your own requirements
This is the github code for the main module:
How it works [top]
- We use iguana.
workingDir()
to find the working directory - Create a
List
table - Iterate through the directory contents and create a list of file attributes:
- Use the
os.fs.glob()
iterator function to return the name and file information for each file - Add an entry for each file into the
List
using the name and file info returned fromos.fs.glob()
- Use the
More information [top]
- Source code for the main module on github
- API documentation for io, os and iguana