could you cache the result of this, so the filesystem is only hit once?