If you cannot get rid off the blank line from RedirectOutput() then you have a couple of choices
  1. Read each file and check if there are only blank lines
  2. Determine if there is a cutoff size below which you can assume that a file is empty. For example, if a file with data is never smaller than 20 bytes then you can assume that a file with less than 20 bytes is empty.