Add missing imports
Merge pull request #2783 from 9rnsr/fix_imports

Add missing imports
fix issue 11434
added version(Posix) to unittest
make windows copy file attributes just as posix

Using getAttributes/setAttributes in the posix version feels wrong
given the rest of the function.