Import file.py functions to win_file.py

Fixes #4663  among other things.

Import non platform specific functions from file.py to win_file.py