I find myself doing this a lot just to ensure the filename is not in use. Is there a better way?
Directory.Exists(name) || File.Exists(name)
bool FileOrDirectoryExists(string path) { try { File.GetAttributes(_source); } catch (FileNotFoundException) { return false; } return true; }