Venu,
I do not think file content (empty line) is the issue. I think, when source program is placing the file, it is placing with restricted access. When you edit it (remove last line), it is saved with proper access.
Please check file properties (it should be 666 https://en.wikipedia.org/wiki/File_system_permissions). Check PI user has permission to edit/delete the file.