moved import fcntl into function so that utile can work on windows