public virtual string GetFileDirectory( string fileName )
{
string f;
if ( haveInputDir && !( fileName.StartsWith( Path.DirectorySeparatorChar.ToString() ) || fileName.StartsWith( Path.AltDirectorySeparatorChar.ToString() ) ) )
{
f = Path.Combine( inputDirectory, fileName );
}
else
{
f = fileName;
}
// And ask .NET what the base directory of this location is
//
return Path.GetDirectoryName( f );
}