From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Panisuan Chasinga Newsgroups: gmane.lisp.guile.user Subject: How to read a string output with `open-input-pipe` on Mac OS? Date: Mon, 9 Oct 2023 17:49:09 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12606"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Oct 10 03:01:02 2023 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qq17N-0003AX-Ut for guile-user@m.gmane-mx.org; Tue, 10 Oct 2023 03:01:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qq171-0002WM-0X; Mon, 09 Oct 2023 21:00:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qq0w8-0001TP-DE for guile-user@gnu.org; Mon, 09 Oct 2023 20:49:24 -0400 Original-Received: from mail-oa1-x2f.google.com ([2001:4860:4864:20::2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qq0w6-0002Or-UY for guile-user@gnu.org; Mon, 09 Oct 2023 20:49:24 -0400 Original-Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-1dcbd8a56d6so3479435fac.1 for ; Mon, 09 Oct 2023 17:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696898961; x=1697503761; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=uQjq9RRQv8BiX+aNBTzDa7NRhtOamYtiYwWA1rgfBX0=; b=I9kt8A9XVOB4fgS/1wPntsdDqEh4Xcz5mM3rB+I8pQjuHIMn4PI/HSOSlOkXilyZK5 Leo+o/Dsr8yIqoqptLStCz17xZ683n/D3lVAGf569fPxzb5v+kZXUME7FXLxechmZe8L 0lPFBOHDnJtyemSJxQJZ074sYaRU+upmo+GB1WKtfBcrK9uqSFTh1ExBRkMD1AhY3iey TadsCdNOpfdmNqH505MtlyceF00aijFgWDqvZYFDzWAf1HdbadQf6Px7BcCT92vXEQ7R R10MFHWr0O2+qqHdcubXA4ozPnZUzVPSA1ufaTrF1sKd3YVDwHxydh+r0bC1aP4ev4q9 Mjng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696898961; x=1697503761; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uQjq9RRQv8BiX+aNBTzDa7NRhtOamYtiYwWA1rgfBX0=; b=Zs6wkKxMDi4QELI2Lt7iK6mASTodg1//lgrxebDCaewtQM5fqN521lxeaV28dmVcb7 vJRDz1AyQuhKAV2o9wmCwmNrwcDtaVAwzmwXa+Gm/p+xMl15w1Jye2jrETzQ69miQZ8I 6S9b3pWDng39Fcy5LbrK2ioGgXm1xra6zSoFykS4Y/57qa5KAV+lx/rBcOphaPj0vx29 gT7x3WCjnVDDc/x45nfluGvEuQa1L0OF0tzmVaUISJQ44wAC0w/JxyoHHTczNqRv3fK7 IHQIZHzDjfJmU34qyoTXis3MQGWCe1YyVu6ja8iJ8RO+KlbqH3b6W8Rhz829t80YgbdI 2cyA== X-Gm-Message-State: AOJu0Yy8HTQ73CgRJYSQnlhF4APxDid/4D9pXNTmP7KZ1Te02OAWLVo3 c+uxt0I763NYZDdan+GCtR6/OyCyByLejgePqoXOcTXJxNhJ5g== X-Google-Smtp-Source: AGHT+IGUOuo0sub16TR4uwDV67aOuad7AiWoJ6A78LIxDuMxa9zTioO9Iv7feYiaJidbMnTRmbLZOBumzLG2shrK0l4= X-Received: by 2002:a05:6870:ea9e:b0:1d6:5483:75e7 with SMTP id s30-20020a056870ea9e00b001d6548375e7mr20716949oap.13.1696898960894; Mon, 09 Oct 2023 17:49:20 -0700 (PDT) Received-SPF: pass client-ip=2001:4860:4864:20::2f; envelope-from=jo.chasinga@gmail.com; helo=mail-oa1-x2f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 09 Oct 2023 21:00:31 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19244 Archived-At: Hi list, I want to read a string output using `ice-9/popen/open-input-pipe` but somehow always got an empty string. Here is my test code: (use-modules (ice-9 popen)) (use-modules (ice-9 textual-ports)) (define (test-read-port) (let* ((port (open-input-pipe "ls")) (str (get-string-all p))) (close-port p) str)) I was able to read from a file with `open-input-file`, but not `open-input-pipe` with any command. Running `(system "ls")` seemed to work just fine.