Send the SCAN command all in one go and interpret responses correctly. Add a test case for file scans.