Directory scan implementation