***devmsv_ is now known as devmsv
<unmatched-paren>hello guilers, is it possible to get the path to the guile binary being used to run the current file? <lloda>(car (program-arguments)), depending on how it was called <unmatched-paren>that prints the name of the script being run, not the `guile` binary running the script <tohoyn>unmatched-paren: maybe (system "ps <proper arguments>") and (getpid) <mwette>unmatched-paren: (readlink "/proc/self/exe") <apteryx>is there a 'call-with-temporary-file' in guile? <mwette>oh, but file not deleted automatically <apteryx>tohoyn: looks good, but I'd use dynamic-wind for the cleanup <apteryx>also, can we have it in Guile proper? :-) <dthompson>I've wanted a call-with-temporary-file a number of times. would be cool to have in the guile standard library. <unmatched-paren>maybe there could be a more abstract (with-files) macro, something like (with-files ((f1 "path/to/f1.text" #:read #t) (f2 'temporary #:read #t #:append #t) ...) ...) <Mudskipper875>mwette: I never knew about /proc/self/exe. Very useful, thanks! ***daviid`` is now known as daviid
<apteryx>tohoyn: your version could be improved with call-with-port, which would remove the need for cleanup <samplet>IIRC, the Scheme standard says it cleans up only if the procedure returns normally. So it doesn’t do cleanup for exceptions, say. This is in case the programmer wants to engage in continuation shenanigans. <samplet>“If PROC does not return, then the port must not be closed automatically unless it is possible to prove that the port will never again be used [...].” <samplet>Looking at the implementation, Guile follows the spec. (I’ve been confused by this before, so I thought I would mention it.) <apteryx>samplet: ah, thanks for pointing that ***karlosz_ is now known as karlosz
<mwette>unmatched-paren: I think you want "${@}" not ${@} <apteryx>mkstemp is a bit odd; it forces you to pass that XXXXXX static string, although it can't be any different. It also doesn't use it as a template (you can't suffix it with more non-template characters) <apteryx>e.g., (mkstemp "/tmp/screenshot-XXXXXX.ppm") is invalid <dsmith-work>"The last six characters of template must be "XXXXXX" and these are replaced with a string that makes the filename unique. Since it will be modified, template must not be a string constant, but should be declared as a character array." <mwette>unmatched-paren: sometimes you get more info if you compile your code with "guild compile -O0"; others have said "-O1" works also