Directory Snippets

When developing applications that need to operate on files and directories it is a common task to, for example, get the list of all sub-directories for a given directory.

This function will not recurs subdirectories - it will only return a list of sub folder on the "first" level.

This is a PHP Class that calculates the size, number of files & folders of a specific directory.

How to select directory using JFileChooser

Normally index.html or index.php is the default page a server serves up when visiting a directory without specifying a file name. You can change this with .htaccess:

05 November, 2012   

PL/SQL example shown below how to use BFILENAME

03 August, 2013   

Example shows bash code to change CWD to file's directory

11 August, 2013   

Returns the given directory with a trailing backslash. If the directory already ends in backslash it is returned unchanged.

17 October, 2011   

Copying Folders With All Contents Including Other Folders. 2010 does not have a built in code to copy full folders with their contents but only files(one by one)!!! But you can do it by this code

03 August, 2013   

ColdFusion code for upload files to directory

18 September, 2013   

PHP example for listing directory contents

Java code example to list the Files or Subdirectories in a Directory

Java code for listing files or sub-directories in a directory

15 September, 2012   

This will perform the action of deleting many files.

11 September, 2011   

This is a minimal apache ant build.xml file that will quickly do all the things that you will generally want to do, including compiling and building a simple Java project to class files and jars. It provides targets to compile the class files and jars and to run the main class. The fields marked "My Project Name Here" and "My Main...

26 April, 2015   

Recursively determines the size of a directory

PHP’s rmdir function does not allow the deletion of a folder if it is not empty.

11 March, 2015   

PHP code shows how to upload images into a mysql database using

30 August, 2015   

Loads the contents of a dir an sorts them by the date of creation.

05 December, 2012   

Instead of providing a traditional address to the image, the image file data is base64-encoded and stuffed within the src attribute. Doing so saves a network request for each image, and prevent exposure of directory paths. Please note that IE7 and below are not compatibles with data URIs.