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=-3.0 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, RCVD_IN_DNSWL_MED,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 C134E29794 for ; Sun, 4 Feb 2024 19:05:04 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1707069904; b=YkssBfTBhnFN5pyY2tKDdNtVwX9GTLt932+yCKxObIF7n8IL+noJ3PV06zpUl6LcK1L6HPnJZP NlCIfgBQ/LYQYhQTwdZ1VIgTtNXfJx+xNyq3307SjFqlULFE8JB8Hr+4U0k4yS3ptanaE1bTJe LUlv4mLSmkzLUzhimaFIqAqFX6f3L9O9lLmitx7oj6n5vdslc1ZdqT3vmcG+i8DuBaFEcuSex7 MD8EPvG/WMexGzNi18oTCLLBcJ4sTWGy+vMJ7ZcQSw4KLdJrX6ySez9pOzmSPXYqhlr+3CNzxn RvR1FRGu4ntlfz7sjLuNjJrYW7UBqos51KEF5iXgbqZjYA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f175.google.com) smtp.remote-ip=209.85.208.175; 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=1707069904; bh=CLHLiADygLDEOzzdoIJyTQC879gDGc/MDyvmU1RiZ0s=; 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=YBmaCKtSe6DjDoU5r4dTrWZOtS52dqJkfWMRLdgPlHu7hjKnI8CKXh3EpvXvq94pV0lLYJ1rBM Nv3ROy/VkIY4utg8l879on03sMSx6oYVHO+dCO19znHCb0eOtZftUJEiqHOJL1WbPHmzI9hCyX O2iJ0LpYHjVyTptAB4eo1ZywqQgvtyZqS2h34/Y3p2ubp5ED0QRbLMmP0sGZhilQ36vQwll+Fx CpT7PZlFSSZpbGPOwqSCtnzabNjQlKuLPmrrVOL6S/JmvB5Bp6MzViulyF84FG13fjf88iFnT3 0pymcn+uuvuoe81FG+oU1ClKIHY5n3cGgWliJOTjcBiGbw==; 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=ftKDA6EUSKVDJhW6QJsvOJI/TY9VIkZ0wCm7M2i82PA=; b=JqcYb8mP4HPEjXgfi2XhfnXH+f wRfqUJxWCmEioh72HAVtXet5aABuAgPOz/p9uZMnVDqD2UenOPT2uS5O9VQDczlz2j7MYJ/0d0Av9 X7TEZuKH4MgiyzRwxyMJxZSI7Zq2oFmdMUILcaqdKDBfh+aY2/yKcgBxJY+B0egmpwO9hxLpzCGUj TBoAr+amlHJFLcEl2FZoPjNMJWmlTzkrLO50b5zclSprBQ1mXHogFtv7VcaWBMU+Uul3AH+UbZBUl mHeLSWyvwQU1nOC1jdoiWQgz+I++8a8t+iJt+zdegWX6pZGVRPFooufc5EFLXGYeC5OXGDI92yYLd JX484+Vw==; Received: by zero.zsh.org with local id 1rWgrY-000Nu2-3i; Sun, 04 Feb 2024 18:05:04 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f175.google.com) smtp.remote-ip=209.85.208.175; 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-f175.google.com ([209.85.208.175]:59693) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rWgrI-000Na3-Li; Sun, 04 Feb 2024 18:04:49 +0000 Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2cf4a22e10dso43624161fa.3 for ; Sun, 04 Feb 2024 10:04:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707069888; x=1707674688; 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=ftKDA6EUSKVDJhW6QJsvOJI/TY9VIkZ0wCm7M2i82PA=; b=L9l4ZUywgN9yGKrCvpc+WkqLnjIN4wgG2IxZj0GAYIPLtDF28lLbe684DloMzHtCHL hia0YeBTvxmPm+mr4ZQyq22pQ17yDWzUlbHBxyhGTXc6fZlBY1x3rb5AEV5gvuKq9XYq sBZ+M+bu3+h6mfHvB8uDflzn3jFbNMmiC5e09eZkInCQoTqBlqPYvuQERn8+HbjI4Jt6 b7m15jOxwT73WJRjcbGrLWIt7k4ulFSPLOklfb0vSujfCWGVsVw6WlPTn7DKZu7Nyz5Z IKD9+PLovFI/r32omJ6IIgwei/3yqVwQ3xRnyLs4KdpsKbAaVuE8a7TIdJp/wFwcbmRe vqhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707069888; x=1707674688; 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=ftKDA6EUSKVDJhW6QJsvOJI/TY9VIkZ0wCm7M2i82PA=; b=NYD4Lz07LXPvMmNrvoqXK/z61q2Z5k1A1rN+CB1Ar91rGApnjX3/tjOosDisVF/RCp H8nZBKx5+lXKkUUMmnO+86i1NgRukjGD0Ml4YeNbOYk17WbgaNGjriYD+LpHlIZt+NFX OfRk7AZgkjWjgm/yJXHCiLCR8kTk8MWtCbnPRaonQ8scQnf+DZYyJ4dNd5ULC35+xIJq LZZbY1bPcSlPBIAb3TQvgWRz5jLuTCb4d8KL8qmFlNV46du3WMdih4Taz8/bvlVO8Yvx kCkQ/NTdmBr7Z2T+N55P0hVpYcwEtY3nDqufvZJ3YePbvWup0Sf/YrKylx/x0JyA/d5/ v4tA== X-Gm-Message-State: AOJu0YztPpf0iDk5B4GhbvnXYQlMSp/RJ/Pcuh5/487swI6qEP/ojoyx 6Uh+/yRQBO0gnrUNZS6GGYTTkfkAXSe/HeSFziZBdJ5Nadzq5X8h7EcDDBORRy9cFQrZBNtnjsG aiNZAFQimfm66iYvePHLkQIvfk/L+MRTr X-Google-Smtp-Source: AGHT+IHXnHPmqDMcWBGIIusSFwjMYovBmqVigWYmaJAoKz99l4X5l/gc+rJSdm4wwwmPJJN40IvIses7jHm2Fd28FtM= X-Received: by 2002:a2e:a4ac:0:b0:2d0:9075:62f1 with SMTP id g12-20020a2ea4ac000000b002d0907562f1mr3629461ljm.42.1707069887859; Sun, 04 Feb 2024 10:04:47 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Mark J. Reed" Date: Sun, 4 Feb 2024 13:04:35 -0500 Message-ID: Subject: Re: mapfile and unset: Does this actually work? To: Bart Schaefer Cc: Zsh hackers list Content-Type: multipart/alternative; boundary="00000000000045d1600610922ee2" X-Seq: 52519 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: --00000000000045d1600610922ee2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I take that back. If the file is nonempty, then the file is deleted. If the file is empty, then it's not. So it seems to be an conflation of unset and empty in the mapfile logic. On Sun, Feb 4, 2024 at 12:57=E2=80=AFPM Mark J. Reed = wrote: > 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. >> >> > > -- > Mark J. Reed > --=20 Mark J. Reed --00000000000045d1600610922ee2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I take that back. If the file is nonempty, then the file i= s deleted. If the file is empty, then it's not. So it seems to be an co= nflation of unset and empty in the mapfile logic.

On Sun, Feb 4, 2024 at 12:= 57=E2=80=AFPM Mark J. Reed <markj= reed@gmail.com> wrote:
FWIW this seems to be a regression introduce= d in your development branch. Using the 5.9 release,=C2=A0unset 'mapfile[removable]'=C2=A0 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 <schaefer@brasslantern.com> wrote:
If= we're contemplating a release, does anyone else want to eyeball this?<= br>
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>


--
Ma= rk J. Reed <mar= kjreed@gmail.com>
--00000000000045d1600610922ee2--