gave directory routines a good cleanup (based on wine) more tcharizing of routines svn path=/trunk/; revision=13615