Go to the source code of this file.
|
function | webglob (in pattern, in anycase) |
| Return a scalar MATLAB string or vector of MATLAB strings containing the fully-resolved paths matching the input pattern.
More...
|
|
◆ webglob()
function webglob |
( |
in |
pattern, |
|
|
in |
anycase |
|
) |
| |
Return a scalar MATLAB string or vector of MATLAB strings containing the fully-resolved paths matching the input pattern.
This function is very similar to pm.sys.path.glob.
However, unlike pm.sys.path.glob, if the input pattern matches a World Wide Web link, it will also download the file to a temporary path on the system and the temporary download path as the output.
- Parameters
-
[in] | pattern | : The input scalar MATLAB string containing either:
-
the pattern to search for paths on the current system.
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:
-
* match zero or more characters.
-
? match any single character.
-
[ab12] match one of the specified characters.
-
[^ab12] match none of the specified characters.
-
[a-z] match one character in range of characters.
-
{a,b,c} matches any one of strings a , b , or c .
-
All above wildcards do not match a file separator.
-
** match zero or more characters including file separators.
This can be used to match zero or more directory parts and will recursively list matching names.
-
the weblink to download and save locally on the system temporary folder.
|
[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.) |
- Returns
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.
- Warning
- Symbolic linked directories or junctions may cause an infinite loop when using the
**
.
Possible calling interfaces ⛓
[pathList, isdirList] = pm.sys.path.webglob(pattern)
[pathList, isdirList] = pm.sys.path.webglob(pattern, anycase)
Example usage ⛓
1cd(fileparts(mfilename(
'fullpath'))); % Change working directory to source code directory.
2addpath(
'../../../../'); % Add the ParaMonte library
root directory to the search path.
5pm.matlab.show(
'pm.sys.path.webglob("https://apod.nasa.gov/apod/astropix.html")')
6pm.matlab.show( pm.sys.path.webglob(
"https://apod.nasa.gov/apod/astropix.html") )
9pm.matlab.show(
'pm.sys.path.webglob("https://github.com/cdslaborg/paramontex/blob/fbeca6745684c798ff28c1bf57cfae0c190db478/MATLAB/mlx/sampling_multivariate_normal_distribution_via_paradram/out/mvn_serial_process_1_report.txt")')
10pm.matlab.show( pm.sys.path.webglob(
"https://github.com/cdslaborg/paramontex/blob/fbeca6745684c798ff28c1bf57cfae0c190db478/MATLAB/mlx/sampling_multivariate_normal_distribution_via_paradram/out/mvn_serial_process_1_report.txt") )
13pm.matlab.show(
'pm.sys.path.webglob("*.m")')
14pm.matlab.show( pm.sys.path.webglob(
"*.m") )
17pm.matlab.show(
'pm.sys.path.webglob("example/array/**")')
18pm.matlab.show( pm.sys.path.webglob(
"example/array/**") )
21pm.matlab.show(
'pm.sys.path.webglob("example/array/**.m")')
22pm.matlab.show( pm.sys.path.webglob(
"example/array/**.m") )
25pm.matlab.show(
'pm.sys.path.webglob("example/array/*.m")')
26pm.matlab.show( pm.sys.path.webglob(
"example/array/*.m") )
29pm.matlab.show(
'pm.sys.path.webglob(".*")')
30pm.matlab.show( pm.sys.path.webglob(
".*") )
33pm.matlab.show(
'[paths, isdir] = pm.sys.path.webglob("**"); paths(~isdir) % get all files in directory tree.')
34 [paths, isdir] = pm.sys.path.webglob(
"**"); paths(~isdir) % get all files in directory tree.
function root()
Return a scalar MATLAB string containing the root directory of the ParaMonte library package.
Example output ⛓
2pm.sys.path.webglob(
"https://apod.nasa.gov/apod/astropix.html")
5pm.sys.path.webglob(
"https://github.com/cdslaborg/paramontex/blob/fbeca6745684c798ff28c1bf57cfae0c190db478/MATLAB/mlx/sampling_multivariate_normal_distribution_via_paradram/out/mvn_serial_process_1_report.txt")
6/tmp/mvn_serial_process_1_report.txt.html
8pm.sys.path.webglob(
"*.m")
12pm.sys.path.webglob(
"example/array/**")
14pm.sys.path.webglob(
"example/array/**.m")
16pm.sys.path.webglob(
"example/array/*.m")
18pm.sys.path.webglob(
".*")
20[paths, isdir] = pm.sys.path.webglob(
"**"); paths(~isdir) % get all files in directory tree.
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.
-
If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
-
If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
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
- Computational Data Science Lab
- Author:
- Joshua Alexander Osborne, May 21 2024, 5:10 AM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin