delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/06/14/11:33:14

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 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
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
To: cygwin AT cygwin DOT com
References: <20220614112532 DOT 7hgkmwm5boz7rqre AT lucy DOT dinwoodie DOT org>
From: Sam Edge <sam DOT edge AT gmx DOT com>
In-Reply-To: <20220614112532.7hgkmwm5boz7rqre@lucy.dinwoodie.org>
X-Provags-ID: V03:K1:jNEOPQmVosucoPANtxCluJojmEvLmYLXg1sjXFle7WcFLYdKRhZ
BmyzIXb3ryFV6knHduCM9tXKWMQ7T76RD/rwQdbds9y2nCK7RFipXEmxVGdfeAlnUbE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
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 AT cygwin DOT com
X-Mailman-Version: 2.1.29
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>
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>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 25EFXEEb022941

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 download
 > 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.  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.  So it's presumably possible to achieve this, although 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.  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 the
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 API
call.

One of the problems the Cygwin maintainers have is that Microsoft introduces
'enhancements' to NTFS & the Win32 API arbitrarily in Windows updates
without
announcing them so it's a game of whack'a'mole.

--
Sam Edge

-- 
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019