Well.. hmm I have main.c and it opens the file and I call the function and after the function is done I close the file in the main.c... It is the right way?