#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG  				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright 2007 - 2011 Christopher Bratusek		#
#							#
#########################################################

dirinfo_date ()
{

	case $1 in

		*get )
			if [[ ! "$2" ]]; then
				DIR="."
			else	DIR="$2"
			fi

			if [[ -d "$DIR" ]]; then
				stat "$DIR" | grep "Modify" | gawk '{print $2}'
			fi
		;;

		*set )
			if [[ ! "$2" ]]; then
				DIR="."
			else	DIR="$2"
			fi

			if [[ -e "$DIR"/.dirinfo ]]; then
				sed -e '/Created/d' -i "$DIR"/.dirinfo
				echo "Created=$($BSNG_RC_DIR/date --get $DIR)" >> "$DIR"/.dirinfo
			fi
		;;

	esac

}
