Commit Graph

93 Commits

Author SHA1 Message Date
Stefan Höck
60ddcd0e07
[ refactor ] export signal to code conversions (#3373)
* [ refactor ] export signal to code conversions

* [ doc ] add documentation

* [ admin ] update CHANGELOG
2024-08-18 10:45:14 +01:00
Steve Dunham
99c665774c [ fix ] check indentation after = in declarations 2024-07-16 11:07:18 +01:00
Denis Buzdalov
da916b68d4 [ fix ] Correctly manage the empty file case while reading a file 2023-12-21 13:30:30 -06:00
Denis Buzdalov
b495fe83f0 [ fix ] Support waiting for popen2-created processes
This fixes problem of creation the garbage of zombie processes on POSIX
systems. This also makes behaviour of `popen2` identical in Windows,
namely, all resources are freed only when waiting, giving at the same
time an ability to observe the exit code afterwards.
2023-12-19 23:03:31 +03:00
G. Allais
b08efbea40
[ refactor ] split Core.TT (#3151) 2023-11-29 20:24:01 +00:00
Aleksei Volkov
af7ba2fa67
[ ttc ] Compare modification time with nanosecond precision (#3046) 2023-08-31 11:55:57 +01:00
Steve Dunham
8d7791ba55
[ base ] Add getTermCols and getTermLines to base library and fix pri… (#3009) 2023-07-18 09:42:47 -05:00
Steve Dunham
9544162bc4
[ new ] Add support for bi-directional pipes on POSIX systems (resolves #2935) (#2944) 2023-04-15 09:39:17 -05:00
Mathew Polzin
ad12f8335c
[ new ] popen/pclose for the NodeJS backend. (#2857)
* implement popen and pclose (to an extent) for NodeJS

* bring node020 back into tests.

* ah, I see what was being done here. Fix the idris for the test.

* fix test's unreachable clause warning

* fix expectation

* Add note to CHANGELOG

* small tweaks to get popen into merge-ready state.
2023-01-30 09:38:42 -06:00
Zoe Stafford
ae2d4efc17 add javascript support to System.Clock
This may behave incorrectly when used with web workers
2022-12-22 11:47:44 +00:00
Zoe Stafford
18ffb852de export {to,from}Nano in System.Clock
also rename some arguments and add docs
2022-12-21 15:49:32 +00:00
Sam Phillips
ba34b64c68 Remove note about differing behavior 2022-10-04 10:24:27 +02:00
wwww
38db7c3d22
[ fix ] showTime pads nanoseconds properly (#2650) 2022-09-22 12:18:26 +01:00
Steve Dunham
e29e2289e7
[ fix ] Fixes memory leaks in currentDir, fGetLine, and fGetChars (#2606) 2022-08-10 21:23:53 +01:00
ProofOfKeags
68a144bf18
Support System.Signal for node backend (#2556)
* first pass at signal support for node backend

* change signal values to int's

* implements defaultSignal

* return -1 as expected by calling API if any error is raised by nodejs runtime

* finishes signal support for nodejs

* extract repetitive foreign import identifiers

* fix comments
2022-07-10 10:18:58 +01:00
Zoe Stafford
68bcacf3ec
[base] add missing node ffi functions (#2427) 2022-04-22 15:45:52 +01:00
Mathew Polzin
c91a768486
System NodeJS additions (#2401) 2022-04-07 10:09:30 +01:00
Nick Drozd
2c9bf24d2f [ libs ] Strengthen some totality checks (#2304) 2022-02-03 18:41:51 +00:00
octeep
9a9412e1a2
make writeBufferData return the number of bytes that have been written (#2276) 2022-01-25 13:25:06 +00:00
stefan-hoeck
1b3be25075 [ breaking, totality ] fGetLine should be covering 2022-01-20 17:48:11 +00:00
octeep
f7bcd1f0b2 make readBufferData return the number of bytes that have been read 2022-01-19 17:35:14 +00:00
Mathew Polzin
266e06cab7
[cleanup] Small round of unused import culling. (#2231)
* small round of unused import culling.

* and also the libraries.
2021-12-29 20:42:29 -08:00
Mathew Polzin
1576a578a0
[ cleanup ] Remove unused imports (#2123)
* contrib library unused import removal
* remove a few unused imports.
* another round of unused import removal
* another round of unused import deletion.
* another round of unused import deletion.
2021-11-18 16:47:36 +00:00
Robert Wright
dc47df688c Add System.File fRead function 2021-11-05 11:59:17 +00:00
Robert Wright
c1fc487bec Return error code from pclose 2021-11-05 11:59:17 +00:00
Robert Wright
c964f8d8bc Add System escapeCmd function 2021-11-05 11:59:17 +00:00
CodingCellist
0dbdcd30be
[ doc ] Document the System module and its submodules. (#2069) 2021-10-29 17:58:29 +01:00
Mathew Polzin
f078d5f5dc
clean up some deprecations (#2057)
* deprecate Data.Nat.Order.decideLTE

* Add properties for LTE/GTE that produce the difference.

* remove deprecated function now that it is available in the base library.

* remove two deprecated lines.

* remove module deprecated since v0.4.0

* fix prelude reference to renamed primitive.

* finish removing Data.Num.Implementations

* remove deprecated dirEntry function.

* remove deprecated fastAppend. Update CHANGELOG.

* replace fastAppend in test case

* replace fastAppend uses in compiler.

* remove new properties that weren't actually very new.
2021-10-24 12:06:57 +01:00
alissa-tung
453305fb6e [base]: add appendFile 2021-10-23 15:20:22 +01:00
Mathew Polzin
654d399eaf
Add function that checks whether a file handle points to a TTY device. (#1908)
* Add function that checks whether a file is a terminal device.

* support isTTY function for NodeJS backend.

* don't accidentally interpret 'false' string as truthy number

* less code duplication.
2021-09-10 08:05:21 +01:00
madman-bob
3e1f6aba56
Add copyFile to System.File (#1797)
Co-authored-by: Stiopa Koltsov <stepan.koltsov@gmail.com>
2021-08-30 15:31:37 +01:00
André Videla
5576d30c27
Merge pull request #1736 from stepancheg/test-discovery
Implement test discovery
2021-07-22 08:56:02 +00:00
Ben Hormann
74db7714d4
[fix] Loading libidris2_support.dll with Racket (#1583) 2021-07-21 14:35:21 +01:00
Stiopa Koltsov
4eff6ac916 System.Directory.listDir
This function is what users want 99.9% of time.
2021-07-17 14:58:57 +01:00
Stiopa Koltsov
c7629e20fe Skip dot and dot-dot in nextDirEntry
These entries returned by `readdir` are legacy of Unix API, we don't
really need them. Most APIs do not return them (for example Java
`Files.newDirectoryStream` or Python `os.listdir`).
2021-07-17 14:58:28 +01:00
Stiopa Koltsov
0ecf74e434 System.Directory.nextDirEntry
* add `nextDirEntry` which returns `Maybe String`, so `Nothing` on
  the end of directory unlike `dirEntry` which returns unspecified error
  on the end of directory
* `dirEntry` is deprecated now, but not removed because compiler depends on it
* native implementation of `dirEntry` is patched to explicitly reset `errno`
  before the `readdir` call: without it end of directory and error were
  indistinguishable
* test added
2021-07-17 14:57:27 +01:00
Stiopa Koltsov
1617d95961 System.Errno.strerror
* add `strerror` function
* move `getErrno` to `System.Errno`
* use `strerror` in `Show FileError`
* on node there's no access to `strerror`, so `strerror` just converts the number to string
2021-07-13 10:34:04 +01:00
Stiopa Koltsov
d676ea6ab4 Expose malloc and free from System.FFI
* Move `malloc`/`free` from `Network.FFI` to `System.FFI`
* Might be useful by other code
2021-07-13 10:24:26 +01:00
Stiopa Koltsov
ed40b212b2 Make System.Signal async-signal-safe
It is not safe to call `malloc` or `pthread_mutex_lock` from signal
handler.
2021-07-12 20:43:26 +01:00
Stefan Höck
599d0635e9
[ refactor ] JS backend overhaul (#1609) 2021-07-10 11:15:21 +01:00
CodingCellist
fac0e32f48
[ fix ] Chez channels (#1596) 2021-07-02 13:13:50 +01:00
Kamiλ Shakirov
8e30b296c0
[ refactor ] Remove Data.Strings module (#1607) 2021-06-28 13:48:37 +01:00
G. Allais
49f8cefeff
[ cleanup ] Test.Golden (#1526) 2021-06-21 17:30:11 +01:00
Nick Drozd
0db136d168
Hoist some pures (#1556) 2021-06-16 15:22:52 +01:00
Robert Wright
c63f25dac2 Distinguish common C and RefC FFI calls 2021-06-14 15:06:44 +01:00
Fabián Heredia Montiel
dad4dcdaf8 Add totality annotations to src and libs/{prelude, base} 2021-06-12 21:06:08 -05:00
Mathew Polzin
a0a417240e
Simple signal handling (#1458) 2021-05-25 16:45:46 +01:00
Robert Wright
f3aae06b28 Add RefC Clock support 2021-05-20 14:25:16 +01:00
Robert Wright
2a957a38d9 Add RefC FFI header file support 2021-05-20 14:25:16 +01:00
Niklas Larsson
473b8ee740 Windows test fixes
Translate node error codes
Strip 'b' from flags
Simplify directory wrangling in chez016
2021-04-12 18:47:57 +02:00