Create treeIO.c

Old version of the code.