From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MHiXBkcKSGLZyAAAgWs5BA (envelope-from ) for ; Sat, 02 Apr 2022 10:33:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wOTAOkYKSGI0ZwAAG6o9tA (envelope-from ) for ; Sat, 02 Apr 2022 10:33:10 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A2084B668 for ; Sat, 2 Apr 2022 10:33:10 +0200 (CEST) Received: from localhost ([::1]:49500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1naZC1-0001TL-Rr for larch@yhetil.org; Sat, 02 Apr 2022 04:33:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naZBH-0001Sq-SU for guix-devel@gnu.org; Sat, 02 Apr 2022 04:32:24 -0400 Received: from [2a02:1800:120:4::f00:15] (port=45972 helo=andre.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1naZBG-0008Mg-9I for guix-devel@gnu.org; Sat, 02 Apr 2022 04:32:23 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by andre.telenet-ops.be with bizsmtp id DkYL2700G4UW6Th01kYLUT; Sat, 02 Apr 2022 10:32:20 +0200 Message-ID: Subject: Re: Getting the name of file-like objects From: Maxime Devos To: Justin Veilleux , guix-devel@gnu.org Date: Sat, 02 Apr 2022 10:32:20 +0200 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-89fCxSSQ63031GQwus8Q" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1648888340; bh=cn6tmRJe/Ty8PIAL/am4ldUoNVVn5GgR19OQDzk1qZU=; h=Subject:From:To:Date:In-Reply-To:References; b=fnBZxnffgOEyzBvTe7lfiZG7tsokqpK98XnKxh13TWMaw23Q9RTjDAAKOXd1vekvK 4mKorJ645v0jwFtnX0q13ddLMoeemQqG/rtsviXuvPKJts/osOYqa+aw46kJm53jaL 9CD5TBM0DCs4Jf+GS6OvNaMIPKxRLWgYkrxrOjTOd86XDvLhFqvA3IdVAlD2re3hL8 cWeFy93HvGFUNKCPtiwI7hZ0beohWWHslgDsy+MhtB4HNQySLacpYOIHBxfEbkOOUE hbt8+OXfqVAdZXD9XlWLD3r/flR+YxSplJyzSMBK3ejgcILadUdzRfkOrWXlcXeXfl nQzCJq6XSyTCg== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:120:4::f00:15 (failed) Received-SPF: pass client-ip=2a02:1800:120:4::f00:15; envelope-from=maximedevos@telenet.be; helo=andre.telenet-ops.be X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, RCVD_IN_DNSWL_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648888390; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cn6tmRJe/Ty8PIAL/am4ldUoNVVn5GgR19OQDzk1qZU=; b=Ry91mDqukvXBWzjAJ1D+6ATiHBrr+vE8H3bzneBJCta9ElUVMAmsLwHBrHgNdGVZdFwMuq 0zw3Wd91ZfnA+pRPC1T2B1ZkyNOblqgkfummkWI3dhjvzqkmgPKC1r2qk0V2rFOMW7zt7C eD1uqaODfyiEEKE2zT3eEGT4KF4dqw5BaNLWComES+dPpFDqliug3F7AR78uMfIwlBiSZF LLzSCSilfnnNw/SIoFfrY1rUHOL68SBZPw8Hilj/SicMDYC345MDfnfk0GHe1vIR1LmVms wK1Wgj3P5G1xwlyFXIQ3iX8HM7j67r8QN7bXyK6jn+CRvyD2M8FKCkuyoXpIQg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648888390; a=rsa-sha256; cv=none; b=IAqaiJ0QAuKStTz9YsdCgqmlziDRBz+1Oo76DVhV1BFRqckQYDXMf/m2o0zSmF+h7hZjwM sbpDWlS2PL90v1yQ58AVax4xHaoueG9tOOW6y43m1Mtdz5H/06BvuUDS6qkw/b+a+TlFue gZQa19NWCsovIOJ41xwq/LB0xo1dMzxyaNybB3Jw+RuSrWt8VGeb0tDxx6bYmXEpE/KW61 vZ1cVHUx4LlfpgWJK+zA6P6/2hwqqVyOpVw7tvz18+Bs/X6Fs2tG+3npML5S8PnYUjKix1 01hNs9bQS2cfazRdRI2G+4Q+dAP6xNzYvCxVfg+jrVqMZhMXnkTAlfMqpZJvEA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r22 header.b=fnBZxnff; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -7.98 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r22 header.b=fnBZxnff; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: A2084B668 X-Spam-Score: -7.98 X-Migadu-Scanner: scn0.migadu.com X-TUID: PvyHtLHzOa9h --=-89fCxSSQ63031GQwus8Q Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Justin Veilleux schreef op vr 01-04-2022 om 16:29 [-0400]: > (define (unzip f) > =C2=A0=C2=A0(computed-file (string-append (name f) "-unzipped") > =C2=A0=C2=A0=C2=A0=C2=A0#~(begin > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(system* (string-append #= $unzip "/bin/unzip") (unrelated) you can do #+(file-append unzip "/bin/unzip") here. The 'file-append' is not very important here, but the #+ is. The difference between #+ (cf. 'native-inputs) and #$ (cf. 'inputs') is important when cross-compiling. Also, I would use 'invoke' instead of 'system*' here -- 'invoke' throws an exception if it fails (making the derivation fail to build), whereas 'system*' silently returns an integer. > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"-d" #$output > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0#$file)) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0#$out)) > ``` >=20 > =C2=A0=C2=A0=C2=A0=C2=A0Is there someting which ressembles the imaginary = `name` function > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0I used above? computed-file-name, local-file-name, package-name ... I don't think there's some generic procedure for this. Greetings, Maxime. --=-89fCxSSQ63031GQwus8Q Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkgKFBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7k9RAQCx7dJWqWnpNilY3+iglPieOxvf xfLWFeln0pmL1B+j3QD/T9sHdvyhI5xheIVk7ZU8QeNkV96po3oBk+woXJYrywo= =GmYy -----END PGP SIGNATURE----- --=-89fCxSSQ63031GQwus8Q--