files

Syntax

files(directory, [pattern])

Details

It must be executed by a logged-in user.

If pattern is not specified, return a table with descriptive information of the files and the sub-directories under directory.

If pattern is specified, return a table with descriptive information of the files and sub-directories that contain pattern in their names.

Parameters

directory is a string indicating a directory path.

pattern (optional) is a string indicating the file name pattern to be searched under the directory.

Returns

A table with the following columns:
  • fileName: the file/directory name.
  • isDir: indicates whether the entry is a directory.
  • fileSize: the size of the file.
  • lastAccessed: last access time.
  • lastModified: last modification time.

Examples

files("D:/06_DolphinDB/01_App/DolphinDB_Win_V0.2");
filename isDir fileSize lastAccessed lastModified
LICENSE_AND_AGREEMENT.txt false 22558 2026.03.24 03:55:19.119 2026.03.24 03:55:19.907
README_WIN.txt false 5104 2026.03.24 03:51:56.331 2026.03.24 03:51:59.091
server true 0 2026.03.24 06:11:27.922 2026.03.24 03:55:19.183
THIRD_PARTY_SOFTWARE_LICENS... false 8435 2026.03.24 03:48:44.566 2025.06.13 02:36:47.453
files("D:/06_DolphinDB/01_App/DolphinDB_Win_V0.2", "readme%");
filename isDir fileSize lastAccessed lastModified
README_WIN.txt false 5104 2026.03.24 03:48:41.830 2025.12.26 08:29:33.239
select * from files("D:/06_DolphinDB/01_App/DolphinDB_Win_V0.2") where filename like "README%";
filename isDir fileSize lastAccessed lastModified
README_WIN.txt false 5104 2026.03.24 03:48:41.830 2025.12.26 08:29:33.239