static bool TryCreateFile( string path )
{
try
{
if( File.Exists( path ) ) return false;
using( File.Create( path ) ) { } // Dispose immediately
return true;
}
catch( IOException ex )
{
if( ex is PathTooLongException || ex is DirectoryNotFoundException ) throw;
}
return false;
}