wrote a Racket version of fdtool.py