glob#
- barecat._api.Barecat.glob(pattern, recursive=False, include_hidden=False)[source]#
Find all files and directories matching a Unix-like glob pattern.
This function is equivalent to Python’s
glob.glob().- Parameters:
- Returns:
List of all file and directory paths matching the pattern.
- Return type:
Examples
>>> bc = Barecat('test.barecat', readonly=False) >>> bc['dir/file.txt'] = b'Hello, world!' >>> bc['dir/subdir/file2.txt'] = b'Hello, world2!' >>> bc.glob('dir/**/*.txt', recursive=True) ['dir/file.txt', 'dir/subdir/file2.txt']