Fix next() for single char args.
Add errno codes.

    Still a touch ugly to use, but it works.
Add recursive path creation.
Put the if in the right place.

    mkpath() should work now.