matlab.buildtool.io.Glob Class
Namespace: matlab.buildtool.io
Superclasses: matlab.buildtool.io.FileCollection
Description
The matlab.buildtool.io.Glob
class represents a collection of files and
folders on disk that match a pattern that includes the *
or
**
wildcard. You can use this class to specify file-based inputs and
outputs of a task. For more information about task inputs and outputs, see Improve Performance with Incremental Builds.
Creation
When you use a string that includes the *
or **
wildcard to specify an argument or property that requires a file collection, MATLAB® automatically converts the string to a Glob
object. For example,
plan("myTask").Inputs = ["*.m" "src/**/*.m"]
results in a 1-by-2
Glob
vector.
To explicitly create a Glob
object, use the matlab.buildtool.io.FileCollection.fromPaths
or files
method.
Properties
Examples
Tips
If you call the
paths
method on aGlob
object, the method returns the paths to the files and folders on disk that match theGlob
pattern. Due to the dynamic nature of disks, callingpaths
at different times can result in different values even though the pattern remains the same.
Version History
Introduced in R2023b