Markdown code blocks migration part 7 (#20547)
This commit is contained in:
parent
13b3ea71da
commit
19ff746916
17 changed files with 426 additions and 411 deletions
|
|
@ -9,18 +9,19 @@
|
|||
|
||||
## This module implements asynchronous file reading and writing.
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## import std/[asyncfile, asyncdispatch, os]
|
||||
## ```Nim
|
||||
## import std/[asyncfile, asyncdispatch, os]
|
||||
##
|
||||
## proc main() {.async.} =
|
||||
## var file = openAsync(getTempDir() / "foobar.txt", fmReadWrite)
|
||||
## await file.write("test")
|
||||
## file.setFilePos(0)
|
||||
## let data = await file.readAll()
|
||||
## doAssert data == "test"
|
||||
## file.close()
|
||||
## proc main() {.async.} =
|
||||
## var file = openAsync(getTempDir() / "foobar.txt", fmReadWrite)
|
||||
## await file.write("test")
|
||||
## file.setFilePos(0)
|
||||
## let data = await file.readAll()
|
||||
## doAssert data == "test"
|
||||
## file.close()
|
||||
##
|
||||
## waitFor main()
|
||||
## waitFor main()
|
||||
## ```
|
||||
|
||||
import asyncdispatch, os
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue