Note: In the below code snippet b will never be equal to 1 as the file is absent, hence the loop runs infinitely. The loop should break after n iteration, but its not workin