MSYS2-packages
MSYS2-packages copied to clipboard
ls -l causes OneDrive to sync files from server.
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
- Open the Windows Explorer and go to a directory that is under control of the OneDrive
- Right click on the files and select "Free up space"
- After this, all the files should have a blue-white cloud icon, which indicates that they are stored only in the cloud.
- Open an MSys2 bash shell and
cd
to that same directory - Type
ls
- The icons in the explorer do not change. This is desired behavior (see the first screen shot)
- Type
ls -l
- 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)
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.
"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.