Use new IO library. Need to look into using streams and things properly, but it pretty much works like this...