in reply to Workaround for my CSV file

If you can't use a module, you can at least look at how the standard modules solve your problem, and mimic that in your own code.