I've written chdir and pwd backends that look at the physical settings, as well as an option parser. I'll have code soon, but be warned that I had to use a for(;;) loop, not a foreach, because I needed an offset to work with :(
I'm making sure that everything works once it's done by running the Configure script :)
