MSYS2-packages icon indicating copy to clipboard operation
MSYS2-packages copied to clipboard

ls -l causes OneDrive to sync files from server.

Open titusjan opened this issue 2 years ago • 10 comments

Describe the issue

When I use the ls -l command in a directory that is under control of OneDrive, it will download the file from the cloud. If I don't use the -l option, the file is not downloaded. This makes ls -l dangerous (or at least annoying) to use because there is always the risk of downloading a large number of files if you accidentally perform an ls -l in a OneDrive directory.

In Cygwin using ls -l does not show this behavior.

Steps to Reproduce the Problem

  1. Open the Windows Explorer and go to a directory that is under control of the OneDrive
  2. Right click on the files and select "Free up space"
  3. After this, all the files should have a blue-white cloud icon, which indicates that they are stored only in the cloud.
  4. Open an MSys2 bash shell and cd to that same directory
  5. Type ls
  6. The icons in the explorer do not change. This is desired behavior (see the first screen shot)
  7. Type ls -l
  8. The OneDrive will download all files from the cloud before printing them in the ls output. This is undesired behavior. All files now have a green check mark icon, which indicates that a local version has been stored on the machine. (see the second screen shot)

image

image

Additional info

MSYS2 coreutils 8.32-2 Cygwin coreutils 8.32-1 Windows 10 Home: 19043.1766 OneDrive for Windows - Version 22.111.0522.0002 (June 3, 2022)

Question

So can you please fix it, or provide a work-around? If not, could you please explain what's going on?

I suspect that ls -l opens the files whereas just ls does not.

Like I said, in Cygwin ls -l performs correctly so I think the issue lies with MSys2. That's why I report it here.

titusjan avatar Jun 21 '22 17:06 titusjan

"find" and "stat" have the same problem with respect to OneDrive, and like "ls", "find" and "stat"s corresponding cygwin implementations do not have this problem. I think this is further evidence that the problem lies with MSYS2 and that it is correctable there, rather than in ls, find, and stat, etc. etc.

codesmacgodes avatar Aug 29 '22 12:08 codesmacgodes