From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout12.t-online.de (mailout12.t-online.de [194.25.134.22]) by sourceware.org (Postfix) with ESMTPS id B138B3858032 for ; Mon, 15 Nov 2021 18:55:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B138B3858032 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=t-online.de Received: from fwd76.dcpf.telekom.de (fwd76.aul.t-online.de [10.223.144.102]) by mailout12.t-online.de (Postfix) with SMTP id C266EE4D8 for ; Mon, 15 Nov 2021 19:54:39 +0100 (CET) Received: from [192.168.2.101] ([87.187.36.180]) by fwd76.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1mmh7m-09cR4y0; Mon, 15 Nov 2021 19:54:38 +0100 Subject: Re: Editing with vim clears Windows 10 file system archive bit. To: cygwin@cygwin.com References: From: Christian Franke Message-ID: <305aedc4-9bb2-02b8-f5ab-f88aba39e9cf@t-online.de> Date: Mon, 15 Nov 2021 19:54:36 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 SeaMonkey/2.53.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TOI-EXPURGATEID: 150726::1637002478-0000144F-F57AA385/0/0 CLEAN NORMAL X-TOI-MSGID: 9c7e27bb-0081-4b73-bb2a-0a867ad72ac0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2021 18:55:41 -0000 Steve Ward via Cygwin wrote: > Description of problem: > While using vim 8.2 on cygwin 3.3 (x86_64) on Windows 10, > when editing an existing file with vim and saving it, the Window’s > file system archive bit is always left cleared (not modified state). > This happens, whether the archive bit was set (is modified) or > clear (not modified) initially. The problem also occurs with 'cp' command: $ touch file1 $ /bin/cp file1 file2 $ /bin/cp --preserve=mode file1 file3 $ lsattr file? ---a-------- file1 ---a-------- file2 ------------ file3 Some Cygwin functions apparently clear the archive attribute unexpectedly, for example: int fd = open(filename, O_CREAT|O_TRUNC|O_WRONLY, 0644); write(fd, "Test\n", 5); fchmod(fd, 0644); // clears archive attribute close(fd); Same with facl(., SETACL, ...). The variants chmod() and acl() are not affected. Regards, Christian