parent
fa7c1aa864
commit
f02de25ca1
1 changed files with 2 additions and 1 deletions
|
|
@ -202,10 +202,11 @@ proc readBuffer*(f: AsyncFile, buf: pointer, size: int): Future[int] =
|
||||||
|
|
||||||
proc read*(f: AsyncFile, size: int): Future[string] =
|
proc read*(f: AsyncFile, size: int): Future[string] =
|
||||||
## Read `size` bytes from the specified file asynchronously starting at
|
## Read `size` bytes from the specified file asynchronously starting at
|
||||||
## the current position of the file pointer.
|
## the current position of the file pointer. `size` should be greater than zero.
|
||||||
##
|
##
|
||||||
## If the file pointer is past the end of the file then an empty string is
|
## If the file pointer is past the end of the file then an empty string is
|
||||||
## returned.
|
## returned.
|
||||||
|
assert size > 0
|
||||||
var retFuture = newFuture[string]("asyncfile.read")
|
var retFuture = newFuture[string]("asyncfile.read")
|
||||||
|
|
||||||
when defined(windows) or defined(nimdoc):
|
when defined(windows) or defined(nimdoc):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue