A newer version of Max is available. Click here to access the latest version of the documentation

folder Reference

List the files in a folder

folder

Description

Outputs all of the file names in a given folder. This can be especially useful for loading a umenu.

Discussion

The forward-slash character ( / ) is used as a path delineator. An initial slash at the beginning of a path indicates the boot volume. The Max application folder is referred to by using period-slash (e.g.: "./Cycling '74/max-help"), and the Cycling '74 folder may be referred to by using C74. A path on Macintosh systems is preceded by the name of the machine and a colon:
"Macintosh HD:/Users/Documents/max stuff/Desktop/phase_vocoder.pat"
On Windows systems, a path is preceded by a drive letter
"C:/Documents/max stuff/Desktop/phase_vocoder.pat"

Arguments

pathname [symbol]

Optional

The absolute path to a folder

Attributes

Common Box Attributes

Messages

bang

Gets the names of all files of a specific type within a specific folder, and outputs those names to be placed in a message object or a pop-up umenu object.

int

Arguments

input [int]
See the bang entry.

anything

Arguments

pathname [list]
See the symbol entry.

symbol

Arguments

pathname [symbol]
Specifies the pathname of a folder in the search path, and causes the contents of that folder to be output for storage in a umenu or a message. Input pathnames can contain slashes, colons, or backslashes as separators.

types

Arguments

typecode [list]
The word types, followed by one or more four-letter filetype codes sets the file types that the folder object will look for in the specified folder.

Output

append

Out left outlet: Immediately following the clear message, each filename in the specified folder is sent out in alphabetical order preceded by the word append.

clear

Out left outlet: When a pathname or a bang is received in the inlet, the first message that is sent out the left outlet is clear, which is intended to erase the contents of a receiving message or umenu object.

int

Out right outlet: When a pathname or a bang is received in the inlet, the number of items in the folder is sent out the right outlet.

See Also

Name Description
conformpath
dropfile
filein
filepath
opendialog
pcontrol
umenu