dotnet / dotnet/dotnet-api-docs

delete, why bother?

Open
#1,412 0 comments 0 reactions 0 assignees View on GitHub
area-System.IO dotnet-api/prod Pri2 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

the first 2 Create(..) signatures have examples with the first reminding users of potential concurrent activity (okay) whilst second is terser (the #3 #4 signatures contribute no enhanced example). Given that the Create method "Creates or overwrites a file in the specified path" the only reason for doing an explicit delete is if a file exists with the R/O attribute set [unlikely and would probably justify a confirmation dialog pop-up if was encountered).
So my suggestion is to remove the delete logic and comments in those 2 examples.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 29d94a8d-341c-5f29-7640-704144f60b69
* Version Independent ID: bb63691f-ecc3-0e26-3297-32b6e329d06a
* Content: [File.Create Method (System.IO)](https://docs.microsoft.com/en-us/dotnet/api/system.io.file.create?view=netframework-4.7.2)
* Content Source: [xml/System.IO/File.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.IO/File.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.