Snippets tagged “glob”
10 snippets use this tag.
- Find all files in a directory with extension .txt in PythonPython
Here is a code snippet that uses the os and glob modules to find all files in a directory with the extension '.txt':
- get all the images from a folder in phpPHP
To get all the images from a folder in PHP, you can use the glob function.
- Getting the names of all files in a directory with PHPPHP
In PHP, you can use the scandir() function to get the names of all files in a directory.
- How can I use PHP to check if a directory is empty?PHP
You can use the scandir() function to get an array of files in a directory, and then check the length of the array.
- How do I check whether a file exists without exceptions?Python
Three approaches to find a file
- How to list files and folder in a dir (PHP)PHP
In PHP, you can use the scandir() function to list the files and directories in a directory.
- How to Remove Files from Folder with PHPPHP
PHP does not have a specific undo for what you delete from anywhere. This snippet will represent how to remove files from folder permanently using PHP.
- How to search for a string in text files?Python
Here's a Python code snippet that demonstrates how to search for a string in all text files in a directory:
- How to use glob() to find files recursively?Python
You can use the glob.glob() function from the glob module to search for files recursively.
- List all files in one directory PHPPHP
To list all files in a directory using PHP, you can use the glob() function.