public static string GetDirectoryName( string dirPath )
{
if ( !dirPath.EndsWith( @"/" ) )
throw new Exception( "Invalid argument for function:GetDirectoryName" );
if ( dirPath == "/" )
return "/";
string noTagDirPath = dirPath.Remove( dirPath.Length - 1 );
return GetFileName( noTagDirPath );
}