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 625 posted 13 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 716 posted 13 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 566 posted 13 years ago by danoph
0 480 posted 13 years ago by silentpro
0 567 posted 13 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 944 posted 13 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 549 posted 13 years ago by studioevoque
Returns an array of files that match a search term in a certain directory.
1 541 posted 13 years ago by mattkenefick
-print0 and -0 are used to allow for spaces and other wacky chars in directory names
0 485 posted 13 years ago by jfine
1 647 posted 13 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 869 posted 13 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 716 posted 13 years ago by powerthru
0 655 posted 13 years ago by iloveitaly
0 489 posted 13 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 711 posted 13 years ago by sandman7OR
Función para obtener el tamaño de un directorio:
0 688 posted 13 years ago by jrobinsonc
Loads of code lifted from here : http://www.tokeru.com/t/bin/view/Maya/MayaPython#ListDir
0 701 posted 13 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 751 posted 13 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 781 posted 14 years ago by karlhorky
Found it on wiki
0 533 posted 14 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 488 posted 14 years ago by Lostindream
0 617 posted 14 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 553 posted 14 years ago by chlab