The tree to file program "treeo" is changed slightly. It doesn't open a file, but uses the pre-existing fd 1 (for stdout) instead. This is its main now: int main(int argc, char * argv[]) { struct node * t = NULL; int x, number, i, f; int * nums; if (argc != 2) { fprintf(stderr, "usage: %s number-of-numbers\n", argv[0]); exit(1); } number = atol(argv[1]); srandomdev(); nums = (int *)malloc(number * sizeof(int)); fill_with_randoms(nums, number); for (i=0; i