ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
Go to the source code of this file.
Functions | |
function | glob (in pattern, in anycase) |
Find all files and directory names matching the input pattern by expanding wildcards. More... | |
function | glob2regexp (in glob_str) |
function | ls_regexp (in regexp_fhandle, in path, in varargin) |
function | ls_regexp_tree (in regexp_fhandle, in path, in varargin) |
function | dir_recur (in startdir, in keep_hidden) |
function dir_recur | ( | in | startdir, |
in | keep_hidden | ||
) |
function glob | ( | in | pattern, |
in | anycase | ||
) |
Find all files and directory names matching the input pattern by expanding wildcards.
This function performs pattern matching of file and directory names, based on wildcard characters.
This function is similar to wildcard expansion performed by the Unix shell and Python glob.glob
function, but it can handle by the Unix shell and Python glob.glob function, but it can handle more types of wildcards.
The following list highlights the key differences between this function and the MATLAB intrinsic dir()
.
glob()
supports wildcards for directories.glob()
returns the directory part of pattern
.glob()
returns a cell array of matching names.glob()
does not return hidden files and directories that start with '.'
unless explicitly specified in pattern
.glob()
does not return '.'
and '..'
unless explicitly specified in pattern
.glob()
adds a trailing file separator to directory names.glob()
does not return the contents of a directory when a directory is specified.'/*'
.glob()
returns only directory names when a trailing file separator is specified.glob()
is not case sensitive, but it returns matching names exactly in the case as they are defined on the filesystem.pattern
.[in] | pattern | : The input scalar MATLAB string, containing the search pattern. Wildcards may be used for basenames and for the directory parts. If pattern contains directory parts, then these will be included in the output pathList .Following wildcards can be used:
|
[in] | anycase | : The input scalar MATLAB logical. If true , the search will be case-sensitive.If false , the search will be case-insensitive.On Windows, anycase is always reset to true even if user-specified.(optional. default = false on Unix and true on Windows.) |
pathList
: The output MATLAB cell array of strings containing the files or directories that match the path specified by string pattern
.isdirList
: The output MATLAB cell array of the same size as pathList
, each element of which is a MATLAB logical value that is true
if and only if the corresponding element of pathList
is a directory.
Possible calling interfaces ⛓
Example usage ⛓
Example usage ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Copyright (c) 2013, Peter van den Biggelaar All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. in no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
function glob2regexp | ( | in | glob_str | ) |
function ls_regexp | ( | in | regexp_fhandle, |
in | path, | ||
in | varargin | ||
) |
function ls_regexp_tree | ( | in | regexp_fhandle, |
in | path, | ||
in | varargin | ||
) |