folders | ||||||||||
Type | function | |||||||||
Dictionary | LCS | |||||||||
Library | LiveCode Script | |||||||||
Syntax |
| |||||||||
Summary | List the subfolders in a folder. | |||||||||
Introduced | 1.0 | |||||||||
Changes | The long form was introduced in version 1.1.
The optional targetFolder argument for the function call form was
introduced in version 8.1.
The | |||||||||
OS | mac, windows, linux, ios, android, web | |||||||||
Platforms | desktop, server, mobile | |||||||||
Parameters |
| |||||||||
Example |
| |||||||||
Values |
| |||||||||
Related | Property: defaultFolder, umask Constant: return Keyword: long Command: sort Function: folders, specialFolderPath, URLDecode, textDecode Glossary: alias, current folder, data fork, folder, function, platform, return, resource fork, shortcut, subfolder, symbolic link | |||||||||
Security | disk | |||||||||
Description | Return a list of folders in the targetFolder, with one file per line. If no targetFolder is specified, list the files in the current folder. The list only includes folders at the top level of the targetFolder. The folders function does not recursively enter and examine folders deeper in the filesystem. To examine the contents of a subfolders, either pass its path as the targetFolder, or temporarily set the defaultFolder. Files are not included in the list. To get a list of files, use the files function. Aliases (on OS X systems), symbolic links|symbolic links (on Linux systems) and shortcuts (on Windows systems) are included in the list only if they refer to a folder. Important: The list returned by the folders contain a ".." entry representing the link to the parent folder. Care must be taken to filter this entry out to prevent infinite loops and security vulnerabilities. Note: The order that folders are listed is platform-dependent. The order may vary between platforms, between filesystems, and even between consecutive calls to the folders function. If you need a sorted list, use the sort command. Short formWhen the folders is called as a function, or without the Note: On some platforms, folder names are permitted to include the linefeed character. Such a folder name would be split across more than one line of the string returned by the folders function. Long form
Each line in the return value is a comma-separated list of file attributes, as follows:
Any attribute that is not relevant to the current platform is left empty. The access permissions consist of three octal digits, in the same form used for the umask property. Note: On Windows, the permissions are always reported as "777". The creator and file type are always "????????". | |||||||||
Tags | file system |