IRC channel logs

2025-05-20.log

back to list of logs

<rlb>technomancy got fennel into debian in time for the trixie release
<identity>is there an equivalent of shell's redirecting output to a file (like "yes >/dev/null") in Guile? should i just do the usual read-u8 -> write-u8 thing?
<ekaitz>identity: what do you mean? call a shell command with redirection? or your make your guile program redirect everything to a file?
<identity>ekaitz: i mean i have a port i got with open-port and i want to write all of it to a file
<identity>all of the program's output, that is
<ekaitz>identity: you can set the current-output-port to something else with `set-current-output-port`
<ekaitz>and then just write, as your program was doing
<identity>ekaitz: i do not think i understand what you are suggesting, how would set-current-output-port help here?
<ekaitz>if you already had your program writing to the current-output-port, redirecting it is just setting that to something else
<ekaitz>but what you want here is copy from one port to another
<ekaitz>and i think that's read from one and write to another like you suggested
<identity>what i am trying to do is, i get a pipe with open-input-pipe, for, say, the /bin/yes program, like (open-input-pipe "yes"), and then i want to write the output to a file, say /dev/null, so something like (sendfile (open-input-pipe "yes") "/dev/null"), but which actually works
<ekaitz>I see
<ekaitz>identity: untested https://paste.debian.net/1375679/ but something like that maybe?
<ekaitz>I'm missing the command in the open-input-pipe but whatever
<ekaitz>this is loading everything in memory, though
<ekaitz>maybe you prefer to read char by char
<identity>ekaitz: does not load for me
<ekaitz>what? it should!
<ekaitz> https://paste.debian.net/plain/1375679
<identity>ekaitz: i guess i could do that too, the data itself is pretty small. thanks!
<ekaitz>no problem!
<optimal>identity: what about something like https://paste.debian.net/1375680/
<ekaitz>oh that's a good one too
<optimal>is there a way to specify which POSIX clock to use with `(current-time)'?
<optimal>i'm currently trying to implement SRFI-170 but there doesn't seem to be a way to do this in the Guile Manual
<optimal>at least not without using FFI
<identity>optimal: i do not think there is a way to get monotonic time in Guile (without FFI/libraries, at least), current-time provides UNIX epoch time
<sneek>wb tohoyn
<tohoyn>sneek: botsnack
<sneek>:)
<optimal>identity: there is an implementation of monotonic time in SRFI-19 but i don't know how spec-compliant it would be if i just reused it
<optimal>i'm not sure if it's... POSIX-y enough