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

Copies only the directory structure on Windows #12

Open
GingerAvalanche opened this issue Sep 20, 2024 · 3 comments
Open

Copies only the directory structure on Windows #12

GingerAvalanche opened this issue Sep 20, 2024 · 3 comments

Comments

@GingerAvalanche
Copy link

GingerAvalanche commented Sep 20, 2024

I have been completely unable to get this crate to copy files on Windows. I have a program with a number of testers on different Windows versions and with different setups for what the program is copying.

I've tried copy_dir() and CopyBuilder::new().run() (both with and without extra property-adder calls) but have never managed to get it to copy a single file on Windows on any computer it's run on. Even a simple test case of copying C:/src to C:/dst with the only file in C:/src being a text file, and it doesn't copy the text file. It copies any directory structure within the source folder perfectly, and then just calls it a day, without any error or other indication that it hasn't finished.

Am I missing some setting or feature flag? It's a bummer, as this seems to be the only remaining, viable, public implementation for recursive folder copying in Rust. On the plus side, works great on Linux!

@GingerAvalanche
Copy link
Author

Ended up implementing my own simple behavior, as I only needed directory and file copying for absolute paths.

Given the nature of the problem and the lack of other reports of a similar nature, it was probably some part of my code or my build environment anyway.

@GingerAvalanche GingerAvalanche closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2024
@woelper
Copy link
Owner

woelper commented Sep 21, 2024

Thank you so much for the issue!

If you believe this is an actual bug please don't close it - I would like to look into it!

@GingerAvalanche
Copy link
Author

I think it might be, but honestly it's difficult to come up with a minimum reproducible example, as the underlying code is so convoluted.

I realized that my simplest tests were still utilizing the program's task dispatch system. When I made a test of just dircpy and nothing else, it worked fine. So it was probably something to do with how dircpy's file copying interacted with the task dispatch system. Unfortunately, I didn't write the task dispatch system, and I don't understand how it works at all, so I'm having trouble simplifying it to give you something to reproduce with.

I also don't understand how dircpy's file copying works, as I never followed the macro back to its definition, but if it shells out the file copy process to the OS, then it's possible dircpy sends a completion signal back to the dispatch system, which kills the thread and any shell invoked from it. Folders, which are practically trivial to make, could be finished before that happens, while files would get cut off. That's just a complete shot in the dark, though.

I'll try to figure out how to get you a reproducible example.

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

No branches or pull requests

2 participants