Commit graph

125 commits

Author SHA1 Message Date
Mario Carneiro
dd313c6894 feat: add IO.FS.rename 2023-07-22 23:21:32 +02:00
Olivier Taïbi
9aeae67708 fix: advance pointer into array when generating random bytes
otherwise if we have more than one chunk then the first one is overwritten
over and over, and the end of the array is not really random
2023-04-06 11:32:12 +02:00
Sebastian Ullrich
15c146b382 feat: proper I/O errors from getLine 2023-03-10 16:27:56 +01:00
Sebastian Ullrich
51e77d152c fix: do not inherit file handles across process creation 2023-03-10 16:27:56 +01:00
Sebastian Ullrich
113de7cca1 refactor: move from fopen to open 2023-03-10 16:27:56 +01:00
Sebastian Ullrich
b010805000 fix: Handle.read at EOF 2022-08-26 20:55:09 -07:00
Andrés Goens
fa22507e8e
feat: blocking behavior on EOF for getLine (#1479) 2022-08-21 16:27:48 +02:00
Jannis Limperg
5ff8f64255 feat: add IO.monoNanosNow 2022-04-11 12:16:20 +02:00
Jannis Limperg
6459ccc43c fix: prevent overflow in lean_io_mono_ms_now 2022-04-11 12:16:20 +02:00
Sebastian Ullrich
1221bdd3c7 fix: use redirected stderr for timeit & allocprof 2021-12-16 06:38:35 -08:00
tydeu
d518ba7f08 feat: use BaseIO more in Init.System.IO 2021-12-14 09:33:52 +01:00
Sebastian Ullrich
0a40269fcb fix: build with mingw-clang64 clang 2021-11-18 09:42:35 +01:00
Mac
eb5852448e
feat: generalize IO task functions to BaseIO := EIO Empty (#744)
* feat: generalize `asTask`/`bindTask`/`mapTask` to `EIO`

* feat: generalize task functions to the `EIO Empty` monad

* chore: fix test + correct doc

* feat: further generalize task functions to `RealM := EIO Empty`

* chore: `RealM`/Task API touch-ups

* refactor: `abbrev RealM` -> `def BaseIO`

* chore: remame args / remove `EIO.toBaseIO_` as per code review

* refactor: use `BaseIO` at `checkCanceled`/`getNumHeartbeats`

* chore: fix `lean_io_bind_task_fn` signature error
2021-11-04 15:37:55 -07:00
Sebastian Ullrich
b13d3e6ca5 fix: dllexport functions not already annotated in header 2021-09-20 18:41:46 +02:00
Sebastian Ullrich
08c2c31fcd feat: IO.FS.removeDir(All) 2021-09-16 07:01:37 -07:00
Sebastian Ullrich
cd7968ba6a chore: IO.FS.removeFile: include path in error messages 2021-09-16 07:01:37 -07:00
Leonardo de Moura
218b9c87b0 feat: expose APIs for creating IO.Error objects 2021-09-11 17:14:43 -07:00
Leonardo de Moura
f9bc4b9b3a feat: add missing APIs 2021-09-11 15:39:11 -07:00
Leonardo de Moura
c8406a301d chore: reduce src/include/lean 2021-09-07 08:24:54 -07:00
Leonardo de Moura
b986bde639 fix: IO.Error.alreadyExists may have an optional file name
We got an assertion violation yesterday at `leanpkg` at
```cpp
  case EEXIST: case EINPROGRESS: case EISCONN:
        lean_assert(fname == nullptr);   // <<<<<<< HERE
        return lean_mk_io_error_already_exists(errnum, details);
```
2021-07-27 07:00:06 -07:00
Wojciech Nawrocki
66258b012b chore: fix windows build 2021-07-24 10:45:28 +02:00
Wojciech Nawrocki
102236fdd9 chore: leftover comment 2021-07-24 10:45:28 +02:00
Wojciech Nawrocki
b3d9e90695 feat: IO.getRandomBytes 2021-07-24 10:45:28 +02:00
Sebastian Ullrich
daac376160 fix: native signature of IO.Process.exit 2021-06-23 08:53:20 +02:00
Daniel Selsam
a22bba7bbf feat: Process.exit
Closes #356
2021-06-11 17:53:51 -07:00
Reijo Jaakkola
32897440dc
fix: change IO.FS.Handle.read to return empty array at EOF
Make EOF handling in IO.FS.Handle consistent with EOF handling in
IO.FS.Handle.getLine. Previously returned error at EOF which ended up
causing segmentation fault. Remove the declaration of g_io_error_eof,
since it becomes redundant.

Closes #349
2021-06-08 13:17:53 +02:00
Wojciech Nawrocki
91d4011aa8 chore: Emscripten realpath 2021-06-06 15:34:44 +02:00
Wojciech Nawrocki
7ca87e50ce chore: Emscripten getenv 2021-06-06 15:34:44 +02:00
Wojciech Nawrocki
485f8ea2d0 feat: setup Emscripten file paths 2021-06-06 15:34:44 +02:00
Wojciech Nawrocki
8ada0ba043 feat: initial Emscripten support 2021-06-06 15:34:44 +02:00
Sebastian Ullrich
a9fa84815b feat: IO.createDir, IO.createDirAll 2021-05-30 17:29:54 +02:00
Sebastian Ullrich
94aea76922 feat: FilePath.metadata 2021-05-30 17:29:54 +02:00
Wojciech Nawrocki
e5182fe4af fix: exported symbol arities 2021-05-29 07:56:54 +02:00
Sebastian Ullrich
f81abe158c fix: memleak in release build 2021-05-26 10:24:45 +02:00
Sebastian Ullrich
2988897cac feat: IO.FS.readDir 2021-05-26 09:47:43 +02:00
Sebastian Ullrich
46ec999a71 fix: don't leak thread-local stream objects
Fixes #245
2021-04-03 10:00:17 +02:00
Leonardo de Moura
acfac85ac0 feat: add IO.getNumHeartbeats 2021-01-24 17:45:50 -08:00
Wojciech Nawrocki
d5ba10a316 feat: IO API for retrieving monotonic time 2021-01-22 18:02:31 +01:00
Wojciech Nawrocki
8addea6e74 chore: remove Handle.size 2021-01-22 18:02:31 +01:00
Sebastian Ullrich
e662992533 feat: IO.removeFile 2021-01-19 19:06:01 +01:00
Wojciech Nawrocki
3fca58ea8c feat: IO.FS.Handle.size 2020-12-23 20:00:36 +01:00
Sebastian Ullrich
562c7ed5ce feat: expose task priorities 2020-09-29 08:01:10 -07:00
Leonardo de Moura
0de92b069f chore: move function 2020-09-21 08:58:41 -07:00
Sebastian Ullrich
a93a53b4b5 feat: more IO Task functions 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
77cbaa752c fix: Task: make reference and -j0 semantics eager, simplify 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
5b83ceb1b5 feat: IO.mapTask, IO.bindTask 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
307a833798 feat: implement IO.asTask as primitive using always-run tasks 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
4bce9eb9a5 doc: document lean_st_ref_get peculiarity 2020-08-31 15:55:21 +02:00
Sebastian Ullrich
c88784ef9d refactor: consistent io_result_mk* naming
/cc @leodemoura
2020-08-31 11:08:57 +02:00
Sebastian Ullrich
1fb1a6f913 fix: do not expose invalid process handles when not redirected 2020-08-30 14:28:56 -07:00