move io out of system (#19442)

* move io out of system

* fix tests

* fix tests

* next step

* rename to syncio

* rename

* fix nimscript

* comma

* fix

* fix parts of errors

* good for now

* fix test
This commit is contained in:
flywind 2022-02-03 00:10:11 +08:00 • committed by GitHub
commit 891329cd4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 92 additions and 42 deletions

View file

@ -92,10 +92,13 @@
## See also
## ========
## * `asyncstreams module <asyncstreams.html>`_
## * `io module <io.html>`_ for `FileMode enum <io.html#FileMode>`_
## * `io module <syncio.html>`_ for `FileMode enum <syncio.html#FileMode>`_
import std/private/since
when defined(nimPreviewSlimSystem):
import std/syncio
proc newEIO(msg: string): owned(ref IOError) =
new(result)
result.msg = msg
@ -1331,7 +1334,7 @@ proc newFileStream*(f: File): owned FileStream =
## * `newStringStream proc <#newStringStream,string>`_ creates a new stream
## from string.
## * `newFileStream proc <#newFileStream,string,FileMode,int>`_ is the same
## as using `open proc <io.html#open,File,string,FileMode,int>`_
## as using `open proc <syncio.html#open,File,string,FileMode,int>`_
## on Examples.
## * `openFileStream proc <#openFileStream,string,FileMode,int>`_ creates a
## file stream from the file name and the mode.
@ -1370,7 +1373,7 @@ proc newFileStream*(filename: string, mode: FileMode = fmRead,
## Creates a new stream from the file named `filename` with the mode `mode`.
##
## If the file cannot be opened, `nil` is returned. See the `io module
## <io.html>`_ for a list of available `FileMode enums <io.html#FileMode>`_.
## <syncio.html>`_ for a list of available `FileMode enums <syncio.html#FileMode>`_.
##
## **Note:**
## * **This function returns nil in case of failure.**