delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2021/04/20/10:47:31

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7+dev
X-Exmh-Isig-CompType: repl
X-Exmh-Isig-Folder: inbox
From: "karl AT aspodata DOT se [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
To: geda-user AT delorie DOT com
Mail-Followup-To: geda-user AT delorie DOT com
Subject: Re: [geda-user] system wide config
In-reply-to: <20210420143556.CC46580770AF@turkos.aspodata.se>
References: <20210417120805 DOT 37DAA824EAA0 AT turkos DOT aspodata DOT se> <YHrjzpKEMOvXREuY AT lepton> <20210417144426 DOT E4238824EAA0 AT turkos DOT aspodata DOT se> <YH4IPPe+k4MZJJkm AT lepton> <20210420004032 DOT 30A6980770A6 AT turkos DOT aspodata DOT se> <YH6T5zzhba9AqGX9 AT lepton> <20210420143556 DOT CC46580770AF AT turkos DOT aspodata DOT se>
Comments: In-reply-to "karl AT aspodata DOT se [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
message dated "Tue, 20 Apr 2021 16:35:56 +0200."
Mime-Version: 1.0
Message-Id: <20210420144634.1456180770AF@turkos.aspodata.se>
Date: Tue, 20 Apr 2021 16:46:34 +0200 (CEST)
X-Virus-Scanned: ClamAV using ClamSMTP
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

 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019