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 <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'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: i guess i could do that too, the data itself is pretty small. thanks! <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 <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 <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