diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/math.nim | 3 | ||||
-rw-r--r-- | lib/pure/os.nim | 4 | ||||
-rw-r--r-- | lib/pure/osproc.nim | 24 |
3 files changed, 17 insertions, 14 deletions
diff --git a/lib/pure/math.nim b/lib/pure/math.nim index cb58ea39b..a9e9010f6 100644 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -352,6 +352,9 @@ proc `^`*[T](x, y: T): T = proc gcd*[T](x, y: T): T = ## Computes the greatest common divisor of ``x`` and ``y``. + ## Note that for floats, the result cannot always be interpreted as + ## "greatest decimal `z` such that ``z*N == x and z*M == y`` + ## where N and M are positive integers." var (x,y) = (x,y) while y != 0: x = x mod y diff --git a/lib/pure/os.nim b/lib/pure/os.nim index f53abe81d..3a5bcbfa1 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -2033,10 +2033,10 @@ proc getFileInfo*(path: string, followSymlink = true): FileInfo = else: var rawInfo: TStat if followSymlink: - if lstat(path, rawInfo) < 0'i32: + if stat(path, rawInfo) < 0'i32: raiseOSError(osLastError()) else: - if stat(path, rawInfo) < 0'i32: + if lstat(path, rawInfo) < 0'i32: raiseOSError(osLastError()) rawToFormalFileInfo(rawInfo, result) diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index dce0673ba..8150f902a 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -195,43 +195,43 @@ proc peekExitCode*(p: Process): int {.tags: [].} proc inputStream*(p: Process): Stream {.rtl, extern: "nosp$1", tags: [].} ## returns ``p``'s input stream for writing to. ## - ## **Warning**: The returned `PStream` should not be closed manually as it - ## is closed when closing the PProcess ``p``. + ## **Warning**: The returned `Stream` should not be closed manually as it + ## is closed when closing the Process ``p``. proc outputStream*(p: Process): Stream {.rtl, extern: "nosp$1", tags: [].} ## returns ``p``'s output stream for reading from. ## - ## **Warning**: The returned `PStream` should not be closed manually as it - ## is closed when closing the PProcess ``p``. + ## **Warning**: The returned `Stream` should not be closed manually as it + ## is closed when closing the Process ``p``. proc errorStream*(p: Process): Stream {.rtl, extern: "nosp$1", tags: [].} ## returns ``p``'s error stream for reading from. ## - ## **Warning**: The returned `PStream` should not be closed manually as it - ## is closed when closing the PProcess ``p``. + ## **Warning**: The returned `Stream` should not be closed manually as it + ## is closed when closing the Process ``p``. proc inputHandle*(p: Process): FileHandle {.rtl, extern: "nosp$1", tags: [].} = ## returns ``p``'s input file handle for writing to. ## - ## **Warning**: The returned `TFileHandle` should not be closed manually as - ## it is closed when closing the PProcess ``p``. + ## **Warning**: The returned `FileHandle` should not be closed manually as + ## it is closed when closing the Process ``p``. result = p.inHandle proc outputHandle*(p: Process): FileHandle {.rtl, extern: "nosp$1", tags: [].} = ## returns ``p``'s output file handle for reading from. ## - ## **Warning**: The returned `TFileHandle` should not be closed manually as - ## it is closed when closing the PProcess ``p``. + ## **Warning**: The returned `FileHandle` should not be closed manually as + ## it is closed when closing the Process ``p``. result = p.outHandle proc errorHandle*(p: Process): FileHandle {.rtl, extern: "nosp$1", tags: [].} = ## returns ``p``'s error file handle for reading from. ## - ## **Warning**: The returned `TFileHandle` should not be closed manually as - ## it is closed when closing the PProcess ``p``. + ## **Warning**: The returned `FileHandle` should not be closed manually as + ## it is closed when closing the Process ``p``. result = p.errHandle proc countProcessors*(): int {.rtl, extern: "nosp$1".} = |