ls/stat on OneDrive causes download of files

Marcin Wisnicki mwisnicki@gmail.com
Wed Mar 6 00:54:58 GMT 2024


If I invoke ls or anything else that does stat inside OneDrive folder
it will trigger download of all files.

OneDrive uses placeholder files[1] to represent remote files.

I'm guessing reading file content in stat is to support detection of
actually executable files as in here[2]?

I think this should be disabled on non-hydrated placeholder files.
Running `find` or 'ls -R` and having your entire OneDrive downloaded
is extremely problematic.

I could live without executable scripts in the OneDrive folder and
it's easy to mark files as always offline to solve it.

Another idea is to skip checking files with extensions known to be
non-executable such as jpg (or just any extensions that is not known
to be executable).

This was previously reported in
https://github.com/msys2/msys2-runtime/issues/206.

[1] https://learn.microsoft.com/en-us/windows/win32/w8cookbook/placeholder-files
[2] https://github.com/msys2/msys2-runtime/blob/msys2-3.4.10/winsup/cygwin/fhandler/disk_file.cc#L548


More information about the Cygwin mailing list