From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by sourceware.org (Postfix) with ESMTPS id A2044383DBBF for ; Tue, 14 Jun 2022 15:32:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A2044383DBBF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1655220742; bh=5D+lVe0d5qJBUf8F+u98v7RyWi8em7hsVJ3Gt1+/jZI=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=HeoZO3iSW21tZ0g02rDvcPnPInJPJZPMe1PflX9l9NZ57Sek4QpxzaQKrRfwWTkjf wWtOiGSFQGxW+UOeAnRrsRdhr36ufP/n0ialqKPjPIP2UTGwyrDN88lHnXf7HMB/Vn NJPZLSNjG56nLKYrpPk3BNWIg+Jfaui9oajo39i4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.15.119] ([88.97.26.74]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MFbW0-1nwAC81fF0-00H8o2 for ; Tue, 14 Jun 2022 17:32:22 +0200 Message-ID: <2fa010d7-3258-742b-5dd6-5985905ce128@gmx.com> Date: Tue, 14 Jun 2022 16:32:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: Wish list: Cygwin `mv` to move OneDrive files without downloading them Content-Language: en-GB To: cygwin@cygwin.com References: <20220614112532.7hgkmwm5boz7rqre@lucy.dinwoodie.org> From: Sam Edge In-Reply-To: <20220614112532.7hgkmwm5boz7rqre@lucy.dinwoodie.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-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HG0ti11v3kU0++J1H/26Pz8LCBhJVQPRtM3Cx7nEZZpAa5fTbhR/o9F SlDlwy+lstCpVQaPcohXKK69ZZUZwq+6DaLZcsPH1U1tGrc00u6RWDyfvjfeeu90SJzSyAJtv i2S2ZevQkje5Sx9bInLZoGqBVMZaB5eQR6deYa8qAG4/cTz/P+tlIRY5if2XKqmwOyYEVTAck WonZoCk1JrEtEEh0uDoifGllUc1OSOn/uVABPqQQo7DkV2eFpd+fwvAIjxKqs4eyx6mkg1Jna rRzhAhY8PbgdVM3AKaQ9KXxNweMUGji5jxLO9l7o//ZB67WjGevYhDtmdwQkvS6f+lKQXQyUg s0tHCG5AfZxJv5uInWvMmL6OpSSfg9iMUvSQL/kBFft3bYhyatPgTDAyw== X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Tue, 14 Jun 2022 15:32:27 -0000 On 14/06/2022 12:25, Adam Dinwoodie wrote: > Microsoft OneDrive has a "Files On-Demand" function, where it will > synchronise file metadata to a local system, but won't actually downloa= d > the file content until an application attempts to read the content. > When moving a file within Cygwin using `mv`, the file always gets > downloaded, which seems like it shouldn't be necessary.=C2=A0 Is there = any > way to have `mv` (and presumably the underlying rename call) work > without downloading the file content in this circumstance? It'd > definitely make some of my life easier, but I'm not sure if it's a > trivial issue, one that would require years of work, or somwhere in > between... > > As best I can tell, `mv` doesn't need to know the content of the file, > at least as long as it's not moving the file outside of OneDrive; it > feels very similar to me to moving a file within a partition on *nix: > generally it's just a case of updating the directory records, with no > need to look at the file content. > > This does work as desired from within PowerShell: PowerShell's > `Move-Item` won't download a file that's not currently stored on the > local system.=C2=A0 So it's presumably possible to achieve this, althou= gh I > don't know if it'd rely on non-public Microsoft APIs, and/or lots more > complexity in the Cygwin code. > > Simple demonstration below, showing the different behaviours of > PowerShell versus Cygwin.=C2=A0 I've not included a cygcheck.out, as I'= m > pretty sure this is much closer to a feature request than a problem > report, but let me know if I've got that wrong. Greetings Adam. I wasn't even aware you could do that with OneDrive - there's still no Explorer way of doing it in Windows 10 21H2 as far as I can see. Thanks for the info. :-) I imagine Cygwin doesn't know about the extended attributes being used within the local copy of your OneDrive directory so it is doing the move using th= e underlying POSIX 'rename within mount' API which hopefully uses the Win32 'rename' but not in a way that carries the new 'O' attribute. Presumably PowerShell's Move-Item does use the right flags to the Win32 AP= I call. One of the problems the Cygwin maintainers have is that Microsoft introduc= es 'enhancements' to NTFS & the Win32 API arbitrarily in Windows updates without announcing them so it's a game of whack'a'mole. =2D- Sam Edge