Closed PyR8zdl closed 4 years ago
Thanks for your contribution.
I've changed it so that os.sched_getaffinity(0)
is preferred because it uses
the number of cores the process is restricted to, not the number of cores that
exist. But I can't test it on Windows. Does that still work for you?
Just tested and it works just fine on windows.
I just wanted to thank you for your work on torf. It is really coming together nicely. I've been using it for my auto upload script and it's nice to be able to have cross-platform modules to make my goal of having my script cross-platform seemless.
Thank you for your kind words.
I think the only other potential cross-platform issue is excluding hidden files. On Unix they just have a leading "." and that works, but Windows seems to have special file attributes for that and I don't want to implement that without being able to test it.
I don't know how common hidden files are on Windows. Maybe that's not a real issue for torf.
I'm not a windows user, I just had someone report that error with my script and took a look at it.
I could see If I can get them to try it and we can test it.
Also, I found another implementation. https://stackoverflow.com/questions/284115/cross-platform-hidden-file-detection/6365265#6365265
OK, if both of us don't really know what the best approach would be, it's probably best to wait for a bug report.
Thanks for the link.
os.sched_getaffinity(0)
Does not work on windows os.Switch to
multiprocessing.cpu_count()
to keep cross platform compatibility