X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Q3vw6ru6j9+gJe8rt4e98v4YoCxtNYGX+TjqjNWxU2s=; b=g9I6vycXYDt347FgLXpJHPV0ywI4pfY0cc4y6aIQwI9KFN8izcvNtT9JmJxJmOYXD0 nC/4Z/gEpXzM2mcZc9SfyF4bp1N3E1XSh+gEkKokuG01oT3yQM2cWFTx9GYn6dm0yDUn J3kXNZYWoO9rJlYXYrd6SxKqeZoXNnyCPsZuMnf+Ehnv0MSSe8EspmT4FJ49bU0gZWoN 4OONSRCOoa0AA2tgzaJlxIGGos8u8lsmUWbhLcge08kJ0EnfmjuGvYPjzUFkJydRPNEq fs5wRzQRTi6O9SrTFYBTT8nY9ysGtVuLlzNjcz6r6gpxA+2pmiZEwKaq6tt2A2Se8BmJ RvkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q3vw6ru6j9+gJe8rt4e98v4YoCxtNYGX+TjqjNWxU2s=; b=tdIqEOkMMcheZUUte4cBxvw107L3QfUdnVlwn8WWcGosBbZSEe+rESD6F1hd2juFds /JaZxSR50qQBZotb+Uw25LCpQdapQDuODjP16NSrMsWX3Uqv+PU9kw1KsoLxp/UhNf9o Vi3+T5T3JFegigscHZVa+C3jELtiQC215Ve2OMsjJCvJIHZJog3TquJUFJjfQec/AxQI ZDjqDTm3K4uwYV3fEoqx7EBVeIP0U4s4i0tkAM7V0MUOo+19hrh2icKrdsN3KSu0AqJn 33l4jqaMpBeDJ8LLXvz0/S27ZgjQtOtpV/GxoOYdIqlbMdSSzSAE2hb0s+vLvi/E0ogT W/vw== X-Gm-Message-State: AOAM532Q2Fod6hBqM3mpZGzY8Jr0UafjpX9z8AVlD1C7DrnRvRVtkN+f Qd/RCesZdlQR0x9P8VebCD8Dygk+C/k= X-Google-Smtp-Source: ABdhPJy+DVLm51DbgfymCay+w6DP+ZHnyegfSeOgPYgE2U2cn0LBpEDMZBzK9h9VfxM7Om3qHlWniw== X-Received: by 2002:ac2:4c03:: with SMTP id t3mr14404233lfq.250.1619463737553; Mon, 26 Apr 2021 12:02:17 -0700 (PDT) Date: Mon, 26 Apr 2021 22:01:49 +0300 From: "dmn (graahnul DOT grom AT gmail DOT com) [via geda-user AT delorie DOT com]" To: geda-user AT delorie DOT com Subject: Re: [geda-user] system wide config Message-ID: <20210426220149.279397ad@demon> In-Reply-To: References: <20210417120805 DOT 37DAA824EAA0 AT turkos DOT aspodata DOT se> <20210417144426 DOT E4238824EAA0 AT turkos DOT aspodata DOT se> <20210420004032 DOT 30A6980770A6 AT turkos DOT aspodata DOT se> <20210420143556 DOT CC46580770AF AT turkos DOT aspodata DOT se> <20210420144634 DOT 1456180770AF AT turkos DOT aspodata DOT se> <20210422091632 DOT 7178ff90 AT demon> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; amd64-portbld-freebsd11.4) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 22 Apr 2021 12:56:22 +0300 "Vladimir Zhbanov (vzhbanov AT gmail DOT com) [via geda-user AT delorie DOT com]" wrote: > On Thu, Apr 22, 2021 at 09:16:32AM +0300, dmn > (graahnul DOT grom AT gmail DOT com) [via geda-user AT delorie DOT com] wrote: > > On Tue, 20 Apr 2021 16:46:34 +0200 (CEST) > > "karl AT aspodata DOT se [via geda-user AT delorie DOT com]" > > wrote: > > > > > I think the following will suit me fine in the future. > > > > > > (use-modules (ice-9 popen)) > > > (use-modules (ice-9 rdelim)) > > > > > > (define (readlink file) > > > (let* > > > ( > > > (port (open-input-pipe (string-append "readlink -f " file))) > > > (str (read-line port)) > > > (close-pipe port) > > > ) > > > str > > > ) > > > ) > > > > > > (define MK (readlink "Makefile")) > > > (define INC (dirname MK)) > > > (define TOP (dirname INC)) > > > ;(display MK) (newline) > > > ;(display INC) (newline) > > > ;(display TOP) (newline) > > > > > > Thanks for the ideas and help. > > > > > > Regards, > > > /Karl Hammar > > > > > > > Karl, first of all, I'd like to thank you for not using the "dog's > > breakfast coding style" (TM)! :-) > > Being not an expert in the bloody lisp programming language, I > > wonder does the call "(close-pipe port)" inside the "let" clause > > get executed? (It looks like a variable definition). > > It's easy to check, use REPL and something like > > (format #t "Closed? ~A\n" (port-closed? port)) > > before resulting 'str'. Thank you, I've tried that. Indeed, in the above context close-pipe is treated just as a local variable, no call to close-pipe(). Regards, Dmitry. -- Lepton Electronic Design Automation https://github.com/lepton-eda/lepton-eda https://graahnul-grom.github.io