From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id C1FC5255B7 for ; Sun, 4 Feb 2024 18:57:48 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1707069468; b=PwINJJ/pzdnb4TM8k3Gqd0jp0F8ZobqU4vFlL3rqelbj1hshDfnF1a3FnK46pLbyGFBT3LaKkH UnMEOyyEwNrg4b36ACKGdV4FOdxwveh+2jp2KI50sHhel3MfZm8sGDefiQzkVujZx+V3xu9Bac DSye8qCcaDx9MMHovTsC+LlNWPZtwKxm+YcEgapPP/ygXTQfwg0kNf6WFyZOtLcWTYWn0l8Z6G PjUULw4t4JOrmay1BkJZ+LmkZOIpi3NpiO9o6fRF6zQt66tvaeNBuBGp33tArVT5A2xG+O4wiL r/+te2j5PT2ykXlHLi+Ts36O7B1tL7/stbSJBauaz6V1Zg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f170.google.com) smtp.remote-ip=209.85.208.170; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1707069468; bh=jkB2/cxZxHdZJkson33R545hayRozgmcv/Go1vEM6WY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=hqYE4RVOqPP18FNtxLxpY404BD0AOniVgSdu8E3LPVZlQYJYOtBTBZP/aiaBT2xDP6uCaOsd29 B1qqlus9eRuaAO+s5IIktkn47B7iLEoBbvFGuMJ2xEl5z5DebNL3SYrMnmT5RcPyPoUBDHVMf8 8QyIoWEUiDgyHpS0SvlkQiWVbM9MtnQnUZk3/LTv+8gTshC43G7+B4xXxfe2roWeWpGDIM+Ldt KiKKv2eW1NkcRdoccJg0qiEFCz2Gecs1Ue5C6X9EwyXFN4ciCFajNYXU5VV8EyEUG/cpP6l8Hg 5uailKT35S940pblQKrUke/v/k3dGWV2dNLrCwCrur9AFw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=wqpImWsOOqB7Rsrjvodk6OHnu+Kzah/wZrNXlmTx+Uc=; b=Ox3CnxeFZsTh1Bxo9+nUqoQOfJ QLzGOHmI9EeozDI8BGY6SrTLn0on1eFmc1c0dhNZ8wNFaZkjGOH9mTf4VWcXv3L+Q9+8lNXd0g1EI +87kalxY7KxEsVj7yMmWS2tUfl1Q0QKBbPkc2Z8bO+ShSNZv/k/lw76Th5OutxLd24aYnmVuEqroC yZ1pCyXRg3kGULPxpy+qh/Y1WhFprw7UPSspe4Ob1T841mdR088reOxxau8v+nYEbal9vIKGKTn/t y9uogFfEVH11JP5jA4MxKFC3V6Dq7SWgmKaLIhoxaSVStIpeRH6sleRAUEhcVsSbRBrLeo89hZ8Eo X7Y8XM5A==; Received: by zero.zsh.org with local id 1rWgkU-000N7F-CH; Sun, 04 Feb 2024 17:57:46 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f170.google.com) smtp.remote-ip=209.85.208.170; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f170.google.com ([209.85.208.170]:59750) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rWgkF-000Mpq-PO; Sun, 04 Feb 2024 17:57:33 +0000 Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2cf4a22e10dso43578761fa.3 for ; Sun, 04 Feb 2024 09:57:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707069451; x=1707674251; darn=zsh.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wqpImWsOOqB7Rsrjvodk6OHnu+Kzah/wZrNXlmTx+Uc=; b=FiFBZEbIsmc0UoSWk/ZxvXoR0ntI4kSlVnIVfG34Z398vZpDbk3P+/2edRYDn3iGEd Bz3OG1NbdFzBws6BfX0yXAfQpcBBTs4CRTzmP0+3ZeuirtMXSjAGeEliIbRyT/z3Q0In IO0lNFXb/ANHXR0SYmuhkj7o/NU9ldyTEeqsX8RwytypGnf7YX9QIm9iZwQZ4pX01IPj gfzJ1G+RY/vtzMtl5P0N3Y6WPTCIG4U3zrzNh80+DBOufn6KhlTYIQBafmm4Qc/SS2Bh iGip/T8DjAwJ7b9WOiIaZmOMGc3sFDfnnosv+dSnG5dU8/6jx+iwaIk1yv5BgUkeewtp c44Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707069451; x=1707674251; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wqpImWsOOqB7Rsrjvodk6OHnu+Kzah/wZrNXlmTx+Uc=; b=m3uuSirhOmq9AejvGpA+30I1vbja2DsnvA/YT0Ju65KyzrezGiJl3LExGvj7Pk1NMJ ZeMFFXsAUs9I3yUoey5UBtdhf9hlA2kx+bq4rQvaS/AfCrTY3aTDvw8ToR2rLeI/vNhq GRNuPucrS6vfupn3BPpqnO15hDl4ZNIPQ+N4D84IwjJpBs9paGpDa56GwYDvafpNHlS4 hxo+M1GMCwMmyUIQWI5iyLWj9OwumKmAnvc0DzCjKoZAq5cNzg5iV9epeNsun6MtrYrk cr6pUIdoRmJ7JQDda4S/AT5WwD6S2FAjj2QkFQgqvm2lxQE1+HC5QAzC/mu0XQW+9NWQ KnNg== X-Gm-Message-State: AOJu0Yz+OmQlARxzsrSvEgZzsun3K7kz3PqPlCAWIYhAMxkQcbyIcBmr JLl4njYBxfVU1CpA9niFjm88mVv98N+YLbhA6tK//1K1Vshb6WQQ2QGC6xtygjZ/gOvo930iPzF qndNKNimtte3PnqBhSoqCsx4OhOab7c+piDU= X-Google-Smtp-Source: AGHT+IEgv/sWqdKspzt6b7YchzxOdfGD5mZaL5P2NJ4+17P/f9605FC/ek11ersBobplsFdVH/K8uX6bxNHaB9bqUnI= X-Received: by 2002:a2e:7817:0:b0:2d0:72ce:ce97 with SMTP id t23-20020a2e7817000000b002d072cece97mr7767439ljc.48.1707069450617; Sun, 04 Feb 2024 09:57:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Mark J. Reed" Date: Sun, 4 Feb 2024 12:57:18 -0500 Message-ID: Subject: Re: mapfile and unset: Does this actually work? To: Bart Schaefer Cc: Zsh hackers list Content-Type: multipart/alternative; boundary="00000000000036072d06109214f8" X-Seq: 52518 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --00000000000036072d06109214f8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable FWIW this seems to be a regression introduced in your development branch. Using the 5.9 release, *unset 'mapfile[removable]'* does indeed delete the file. I tested on macOS, Windows+msys2, and Ubuntu. On Sat, Feb 3, 2024 at 11:25=E2=80=AFPM Bart Schaefer wrote: > If we're contemplating a release, does anyone else want to eyeball this? > > On Sun, Jan 21, 2024 at 6:05=E2=80=AFPM Bart Schaefer > wrote: > > > > Doc says: > > > > mapfile > > This associative array takes as keys the names of files; the > > resulting value is the content of the file. The value is treated > > identically to any other text coming from a parameter. The value > > may also be assigned to, in which case the file in question is > > written (whether or not it originally existed); or an element may > > be unset, which will delete the file in question. > > > > However: > > > > % touch removable > > % zmodload zsh/mapfile > > % : $mapfile[removable] ; unset 'mapfile[removable]' > > % ls -l removable > > -rw-rw-r-- 1 schaefer schaefer 0 Jan 21 17:17 removable > > > > I tried several variations of this and I can't get mapfile to remove > anything. > > I still haven't worked out what's going on here. > > --=20 Mark J. Reed --00000000000036072d06109214f8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
FWIW this seems to be a regression introduced in your deve= lopment branch. Using the 5.9 release,=C2=A0uns= et 'mapfile[removable]'=C2=A0 does indeed delete the fil= e. I tested on macOS, Windows+msys2, and Ubuntu.


On Sat, Feb = 3, 2024 at 11:25=E2=80=AFPM Bart Schaefer <schaefer@brasslantern.com> wrote:
If we're contemplating a relea= se, does anyone else want to eyeball this?

On Sun, Jan 21, 2024 at 6:05=E2=80=AFPM Bart Schaefer <schaefer@brasslantern.com= > wrote:
>
> Doc says:
>
> mapfile
>=C2=A0 =C2=A0 =C2=A0 This associative array takes as keys the names of = files; the
>=C2=A0 =C2=A0 =C2=A0 resulting value is the content of the file.=C2=A0 = The value is treated
>=C2=A0 =C2=A0 =C2=A0 identically to any other text coming from a parame= ter.=C2=A0 The value
>=C2=A0 =C2=A0 =C2=A0 may also be assigned to, in which case the file in= question is
>=C2=A0 =C2=A0 =C2=A0 written (whether or not it originally existed); or= an element may
>=C2=A0 =C2=A0 =C2=A0 be unset, which will delete the file in question.<= br> >
> However:
>
> % touch removable
> % zmodload zsh/mapfile
> % : $mapfile[removable] ; unset 'mapfile[removable]'
> % ls -l removable
> -rw-rw-r-- 1 schaefer schaefer 0 Jan 21 17:17 removable
>
> I tried several variations of this and I can't get mapfile to remo= ve anything.

I still haven't worked out what's going on here.



--
Ma= rk J. Reed <mar= kjreed@gmail.com>
--00000000000036072d06109214f8--