CK.Core.FileUtil.TryCreateFile C# (CSharp) Method

TryCreateFile() static private method

static private TryCreateFile ( string path ) : bool
path string
return bool
        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;
        }