Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ls/stat on OneDrive causes download of files #206

Closed
mwisnicki opened this issue Mar 3, 2024 · 7 comments · Fixed by #209
Closed

ls/stat on OneDrive causes download of files #206

mwisnicki opened this issue Mar 3, 2024 · 7 comments · Fixed by #209

Comments

@mwisnicki
Copy link

mwisnicki commented Mar 3, 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 to represent remote files.

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

I think this should be disabled on non-hydrated placeholder files.

@dscho
Copy link
Collaborator

dscho commented Mar 4, 2024

Sadly, this is within the l design of Cygwin/MSYS2: to determine whether a file is a script, the runtime needs to read the first few bytes from the file. And the way OneDrive seems to operate, it anticipates from that read that the entire file is needed locally.

@mwisnicki
Copy link
Author

I would be happy to have non-hydrated placeholder files to be non-executable.

@mwisnicki
Copy link
Author

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

@dscho
Copy link
Collaborator

dscho commented Mar 5, 2024

I would be happy to have non-hydrated placeholder files to be non-executable.

I fear that I have not managed to make myself plain: This behavior is a design decision of Cygwin. If you want to convince anybody to change that behavior, you will need to take it up with the Cygwin maintainers (see https://cygwin.com/problems.html for details).

@mwisnicki
Copy link
Author

Thanks. I thought MSYS forked off Cygwin long ago. Didn't realize it's still tracking upstream.

@mwisnicki
Copy link
Author

mwisnicki commented Mar 6, 2024

@dscho
Copy link
Collaborator

dscho commented Mar 6, 2024

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants