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 20 posted 9 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 27 posted 9 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 20 posted 9 years ago by danoph
0 11 posted 9 years ago by silentpro
0 14 posted 9 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 43 posted 9 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 11 posted 9 years ago by studioevoque
Returns an array of files that match a search term in a certain directory.
1 16 posted 9 years ago by mattkenefick
-print0 and -0 are used to allow for spaces and other wacky chars in directory names
0 16 posted 9 years ago by jfine
1 22 posted 9 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 24 posted 9 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 19 posted 9 years ago by powerthru
0 20 posted 9 years ago by iloveitaly
0 14 posted 9 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 21 posted 9 years ago by sandman7OR
Función para obtener el tamaño de un directorio:
0 20 posted 9 years ago by jrobinsonc
Loads of code lifted from here : http://www.tokeru.com/t/bin/view/Maya/MayaPython#ListDir
0 25 posted 9 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 31 posted 9 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 24 posted 9 years ago by karlhorky
Found it on wiki
0 17 posted 9 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 12 posted 10 years ago by Lostindream
0 18 posted 10 years ago by blackf0rk