Skip to content

Commit 53b3082

Browse files
ClémentClément
authored andcommitted
Trying to fix formatting, again.
1 parent 7a084cb commit 53b3082

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

source/solutions/io/files.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ tags:
4646
StreamWriter sw = new StreamWriter(filePath);
4747
sw.WriteLine("Hello World!!");
4848
```
49-
49+
5050
<details><summary>Solution</summary>
5151
This program would
52-
52+
5353
#. Create a file located at `filePath`,
5454
#. Store in the file "Hello World!!", followed by a new line.
55-
55+
5656
This program is unsafe because:
57-
57+
5858
#. It does not close the file properly,
5959
#. It can throw exceptions if e.g., `filePath` cannot be accessed by the program,
6060
#. It possibly overwrites the file located at `filePath`.
61-
61+
6262
To solve those, it should be edited to:
63-
63+
6464
#. Close the file using `sw.Close()`,
6565
#. Be wrapped inside a `try`…`catch` block,
6666
#. Either test first if the file exists, or use the `StreamWriter` constructor that appends to the file if it already exists.

0 commit comments

Comments
 (0)