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 612 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 694 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 555 posted 13 years ago by danoph
0 472 posted 13 years ago by silentpro
0 558 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 925 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 534 posted 13 years ago by studioevoque
Returns an array of files that match a search term in a certain directory.
1 526 posted 13 years ago by mattkenefick
-print0 and -0 are used to allow for spaces and other wacky chars in directory names
0 476 posted 13 years ago by jfine
1 634 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 858 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 702 posted 13 years ago by powerthru
0 640 posted 13 years ago by iloveitaly
0 479 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 704 posted 13 years ago by sandman7OR
Función para obtener el tamaño de un directorio:
0 674 posted 13 years ago by jrobinsonc
Loads of code lifted from here : http://www.tokeru.com/t/bin/view/Maya/MayaPython#ListDir
0 687 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 737 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 767 posted 14 years ago by karlhorky
Found it on wiki
0 522 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 482 posted 14 years ago by Lostindream
0 605 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 544 posted 14 years ago by chlab