This will not work on windows 

Perhaps something like http://stackoverflow.com/a/17521358/800016