Attempts to get dirname working? should really use pkgutil