Welcome To Snipplr


Everyone's Recent Snippets Tagged directory



currently formatted for use on mediatemple server. replace file path with absolute path of resources.
0 1818 posted 15 years ago by dan_hoerr
This function empties the folder recursively. Two parameters are passed in the function, First one is the directory to be emptied and second one is the flag to determine whether to delete the given folder. If set 'true', given folder is also removed...
0 2085 posted 15 years ago by nilambar
There are a lot of recursive glob functions out there but they don't build a tree, they build a 1 dimensional array...This function builds a directory tree.
1 1849 posted 15 years ago by danoph
0 1495 posted 15 years ago by silentpro
0 1593 posted 15 years ago by kyrathaba
There seems to be many scan directory systems but I could not find one that works the way I needed. I added in functionality for a search filter and an ignore list. The search filter and ignore list can ignore by extension, file (case-sensitive file...
1 2359 posted 15 years ago by SoN9ne
A "quick and dirty" way to delete a directory. For more cleaner implementation, see http://www.google.com/codesearch/p?hl=en#SS2by_AKaLs/src/org/apache/commons/io/FileUtils.java&q=cleanDirectory&l=972
0 1665 posted 15 years ago by studioevoque
Returns an array of files that match a search term in a certain directory.
1 1671 posted 15 years ago by mattkenefick
-print0 and -0 are used to allow for spaces and other wacky chars in directory names
0 1585 posted 15 years ago by jfine
1 1915 posted 15 years ago by nveselinov
Expects all files to be in the current directory; does not recurse into subdirectories. Replace "TEXTTOREMOVE" with the text you wish to remove from the filename. Replace *.csv with a search term appropriate for your situation.
0 2462 posted 15 years ago by powerthru
Execute on the command line. Assumes all files are in the current directory; does not recurse into subdirectories. Replace "*.html" with correct search term for your situation; replace "FS-" with the leading text you wish to remove. This example remo...
0 2048 posted 15 years ago by powerthru
0 2958 posted 15 years ago by iloveitaly
0 1573 posted 15 years ago by pflangan
Loops through all files of a certain extension in the specified directory. Can be used to list all images in a given directory.
0 1990 posted 15 years ago by sandman7OR
Función para obtener el tamaño de un directorio:
0 1941 posted 15 years ago by jrobinsonc
Loads of code lifted from here : http://www.tokeru.com/t/bin/view/Maya/MayaPython#ListDir
0 1982 posted 16 years ago by throb
This command line aims at moving directories from a target location to the present working directory (pwd), backing the pwd directories up as it encounters them. The script works by: 1. Iterating through the contents of the target directory (us...
0 2169 posted 16 years ago by karlhorky
This batch mirrors the contents of one directory to another using Robocopy. It will display a list of what is being mirrored before prompting the user for confirmation on the mirror. WARNING: Robocopy's /MIR switch that is used in this batch WILL...
1 2254 posted 16 years ago by karlhorky
Found it on wiki
0 1513 posted 16 years ago by TEHEK
Very simple to use. **Calling:** $files = dirContents(DIR_PATH, [FILTER, [TYPE]]); **Examples:** $files = dirContens("my-dir"); _$files_ is array containing all, both files either directories $files = dirContens("my-dir",...
0 1546 posted 16 years ago by Lostindream
0 1915 posted 16 years ago by blackf0rk
Here is a function you can use to automatically set up a complex folder structure with a specified file mode. All you have to do is create the "root" directory and pass an array describing the folder structure you would like to create in it. If the d...
0 1564 posted 16 years ago by chlab