Main Content



Get file name of file read by datastore

Since R2020a


n = getCurrentFilename(ds,info)


n = getCurrentFilename(ds,info) returns the file name of the file currently being read by the datastore ds.

If your custom datastore subclasses from, then it inherits a getCurrentFilename method that retrieves the file name from the info output of the read method. If the datastore primarily works with files that require multiple reads per file, then you must implement your own getCurrentFilename and currentFileIndexComparator methods in the subclass. These methods tell the datastore which file is being read, and whether the file requires multiple reads.

Input Arguments

expand all

Input datastore, specified as a datastore object that inherits from To create a datastore object, see

Data info returned by read, specified as a structure.

Output Arguments

expand all

File name, returned as a character vector.



To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2020a