Main Content

getCurrentFilename

Class: matlab.io.datastore.FileWritable
Namespace: matlab.io.datastore

Get file name of file read by datastore

Since R2020a

Syntax

n = getCurrentFilename(ds,info)

Description

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

If your custom datastore subclasses from matlab.io.datastore.FileWritable, 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 matlab.io.datastore.FileWritable. To create a datastore object, see matlab.io.Datastore.

Data info returned by read, specified as a structure.

Output Arguments

expand all

File name, returned as a character vector.

Attributes

Accessprotected

To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2020a