I have a function where I am trying to reach the last index of the file contents. When i use descriptors and lseek combination as given below, things work normally: