How to read from a file during execution