Abstracting directory scans