shared nonBinaryFileFilter function