X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com 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 Subject: Re: Editing with vim clears Windows 10 file system archive bit. To: cygwin AT cygwin DOT com References: <SN6PR04MB4799AEB60421601D02E22680BB979 AT SN6PR04MB4799 DOT namprd04 DOT prod DOT outlook DOT com> From: Christian Franke <Christian DOT Franke AT t-online DOT de> 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: <SN6PR04MB4799AEB60421601D02E22680BB979@SN6PR04MB4799.namprd04.prod.outlook.com> 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 AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com> List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>, <mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe> List-Archive: <https://cygwin.com/pipermail/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help> List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>, <mailto:cygwin-request AT cygwin DOT com?subject=subscribe> Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 1AFIwQ1A019334 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 -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple