summary refs log tree commit diff stats
path: root/lib/pure/osproc.nim
Commit message (Collapse)AuthorAgeFilesLines
* Markdown code blocks migration part 8 (#22478)Andrey Makarov2023-08-151-15/+15
|
* replace `doAssert false` with `raiseAssert` in lib, which works better with ↵ringabout2023-08-111-1/+1
| | | | strictdefs (#22458)
* NuttX: use posix_spawn for osproc (#21539)Hiroki Noda2023-03-201-4/+6
| | | | | NuttX has standard posix_spawn interface, and can be used with it. * https://nuttx.apache.org/docs/12.0.0/reference/user/01_task_control.html#c.posix_spawn
* Add warning to specify timeout value in milliseconds, Fix #21449 (#21471)Sultan Al Isaiee2023-03-041-0/+4
| | | a warning message been added to the documentation to remind users that the timeout parameter is expressed in milliseconds, not seconds. to help prevent confusion and unexpected behaviours.
* remove decades-deprecated Win32 API *A function support (#21315)tersec2023-03-021-23/+12
|
* fixes #21393 and misc style changes (#21419)Andreas Rumpf2023-02-241-6/+2
| | | | | | | | | * fixes #21393 and misc style changes * progress --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Refines raises list in osproc (#21323)ringabout2023-02-141-20/+21
| | | | | | | | | | | | | | | | | | | | | | * Remove Exception from raises in closeImpl * Update osproc.nim * refine errors * add ValueError * cast raises * refactor raises lists * Update lib/pure/osproc.nim * Update lib/pure/osproc.nim --------- Co-authored-by: Antonis Geralis <43617260+planetis-m@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* move widestrs out of system (#20462)metagn2022-10-011-0/+2
| | | | | * move widestrs out of system * fix osproc
* make implicit cstring conversions explicit (#19488)ee72022-08-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Nim manual says that an implicit conversion to cstring will eventually not be allowed [1]: A Nim `string` is implicitly convertible to `cstring` for convenience. [...] Even though the conversion is implicit, it is not *safe*: The garbage collector does not consider a `cstring` to be a root and may collect the underlying memory. For this reason, the implicit conversion will be removed in future releases of the Nim compiler. Certain idioms like conversion of a `const` string to `cstring` are safe and will remain to be allowed. And from Nim 1.6.0, such a conversion triggers a warning [2]: A dangerous implicit conversion to `cstring` now triggers a `[CStringConv]` warning. This warning will become an error in future versions! Use an explicit conversion like `cstring(x)` in order to silence the warning. However, some files in this repo produced such a warning. For example, before this commit, compiling `parsejson.nim` would produce: /foo/Nim/lib/pure/parsejson.nim(221, 37) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv] /foo/Nim/lib/pure/parsejson.nim(231, 39) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv] This commit resolves the most visible `CStringConv` warnings, making the cstring conversions explicit. [1] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/doc/manual.md#cstring-type [2] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/changelogs/changelog_1_6_0.md#type-system
* Fixes return values of execCmd on macos (#19963)Daniel Clarke2022-07-051-1/+1
| | | | | | | * Fixes return values of execCmd on macos * update tests to use existing structure Co-authored-by: daniel <danielclarke@wearepopgun.com>
* Remove deprecated typo poDemon (#19631)Juan Carlos2022-03-231-5/+0
| | | | | * Remove Deprecated poDemon * Remove Deprecated poDemon
* move assertions out of system (#19599)flywind2022-03-231-0/+4
|
* Fix process lines iterator (#19605)Dominic Ward2022-03-231-6/+8
| | | | | | | * Ensure lines when process done * eliminate post-EOF exit test * Recommend fixes for execCmdEx/execProcess
* fixes #18858 [backport] (#18868)Andreas Rumpf2021-09-191-1/+5
| | | | | | | * fixes #18858 [backport] * ensure async tests work with --experimental:strictEffects [backport] * ensure async tests work with --experimental:strictEffects [backport]
* typo: nonexistant => nonexistent (#17918)Timothee Cour2021-05-021-1/+1
| | | | | * typo: nonexistant => nonexistent * fix test (ordering differs because of https://github.com/nim-lang/Nim/issues/17910)
* Use `.. warning::` (#17320)konsumlamm2021-03-101-24/+23
|
* use lowercase --define switches (#17283)flywind2021-03-071-1/+1
|
* Change stdlib imports to use std prefix in most examples (#17202)Danil Yarantsev2021-02-281-1/+1
|
* add -d:nimStrictMode in CI to keep code from regressing; fixes ↵Timothee Cour2021-02-171-1/+1
| | | | ConvFromXtoItselfNotNeeded, UnusedImport notes (#16764)
* fix some warnings (#16952)flywind2021-02-081-5/+5
|
* Deprecate TaintedString (#15423)Juan Carlos2021-01-151-7/+7
| | | | Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* reuse const (#16422)n5m2021-01-011-1/+1
|
* link to POSIX sendSignal from osproc.kill docs (#16475)n5m2021-01-011-0/+2
| | | and from osproc.terminate docs
* Fix osproc so that it doesn't close pipe/process/thread handles twice ↵Tomohiro2020-12-181-18/+40
| | | | | | | (#16385) [backport] * Add error check to closeHandle and fix closing handle twice in osproc * Fix compile error on Linux
* Fix broken links in docs (#16336)Elliot Waite2020-12-141-1/+1
| | | | | * Fix broken links in docs * Fix rand HSlice links
* typoAraq2020-10-061-1/+1
|
* Add first draft of new osproc.readLines (#15429)c-blake2020-10-011-0/+51
| | | | | | | | | | | | | | | | | | | | | * Add first draft of new osproc.readLines * Add test for new osproc.readLines * Rename test to start w/t to run; Also add newline to output * Suppress hint messages. * Output should match this time. * Shoulda picked a program with simpler syntax than ..lol * Address https://github.com/nim-lang/Nim/pull/15429#issuecomment-701890898 and https://github.com/nim-lang/Nim/pull/15429#issuecomment-701985976 by factoring `readLines` into `iterator lines` and a wrapper `proc`. * Address https://github.com/nim-lang/Nim/pull/15429#issuecomment-702127289 and also add a `ReadIOEffect` tag to the iterator (called by the wrapper.. so it should need no separate tag, if I understand correctly).
* Fix #14906 (#14949)Tomohiro2020-07-181-7/+64
| | | | | | | | | | | | | | | | | | | | | | | * Fix #14906 by wrapping outputStream with PipeOutStream * Fix compile error when ./build_all.sh * Use PipeOutStream on posix * Fix compile error when build_all.sh * Use ptr UncheckedArray * Replace copyRefObj * Remove tmp buffer from posPeekData * Add more tests for outputStream * Add comments about PipeOutStream.buffer * Fix bug in posReadLine * Move implementation of newPipeOutStream to streamwrapper module
* turn 'runnableExample' into 'code-block' to make nightlies greennarimiran2020-06-251-9/+12
| | | | | This example doesn't work on our nightlies CI. Other procs in this module already use 'code-block'.
* `osproc.execCmdEx` now takes an optional `input` for stdin, `env`, ↵Timothee Cour2020-05-131-12/+31
| | | | | | | workingDir (#14211) * `osproc.execCmdEx` now takes an optional `input` for stdin * execCmdEx now also takes an optional ``workingDir` and `env`
* fix a critical bug in windows.osproc leading to resource leaks and blocking ↵Timothee Cour2020-05-111-1/+5
| | | | IO [backport] (#14296)
* fix #14203 (#14204)slangmgh2020-05-031-1/+4
|
* change 'iff' to 'if' to stop "corrections" once and for all (#14182)Miran2020-05-011-1/+1
|
* osproc: added a better version of waitForExit for Haiku (#13938)alaviss2020-04-101-0/+61
| | | Also modified tosprocterminate to verify waitForExit implementations.
* Deprecate when declared(echo):echo (#13840)Juan Carlos2020-04-021-1/+1
|
* Documentation, add more examples (#13825)Juan Carlos2020-04-011-0/+1
|
* More fixes for Haiku (#13774)alaviss2020-03-271-47/+48
| | | | | | | | | | | * osproc: move fork-based code path under the when conditional * osproc: avoid using the environ global on Haiku * osenv: import environ from stdlib.h on Haiku Haiku's environ is declared in `<stdlib.h>` by default, differing from POSIX and/or Linux. Import it from there to avoid collision with anyone importing `<stdlib.h>` from Nim.
* Fix error check code in osproc (#13090) [backport]Tomohiro2020-01-091-1/+1
|
* osproc: fixes regressionAraq2019-12-241-1/+1
|
* ported osproc.nim to ARCAraq2019-12-241-1/+1
|
* osproc needs 'import linux' for -d:useCloneAndreas Rumpf2019-11-071-0/+3
|
* remove unused importsnarimiran2019-11-061-3/+0
|
* use system.move instead of system.shallowCopy if the GC mode requires itAndreas Rumpf2019-10-041-6/+4
|
* [backport] run nimpretty on os-related stuffnarimiran2019-09-301-93/+81
|
* styleCheck: make the compiler and large parts of the stdlib compatible with ↵Araq2019-07-101-8/+8
| | | | --styleCheck:error
* ABI fixes for OSX/BSD; fixes #6860 (#11666)Andreas Rumpf2019-07-061-1/+1
|
* [bugfix] remove dangling ref (#11576)Jasper Jenkins2019-06-251-1/+1
|
* makes koch.nim sem'check with --newruntimeAraq2019-04-061-4/+10
|
* see what appveyor thinks about thisAraq2019-04-011-1/+1
|
* newruntime: progressAraq2019-04-011-4/+4
|