move scan_external_dir() to auxlib