This question already has an answer here:
I'm reading a file part by part and want to print the File Position (Byte Position). Example code snippet:
inFile *os.File
inFile, err := os.Open(myfile)
size := make([]byte, some_size)
content_size, err := inFile.Read(size)
Now this is done in a loop with various buffer sizes. So do I have to maintain a variable where I'll add up the content size obtained as return data from Read?
Instead, can I get the position (Bytes) of the file pointer after all the Read operations are done? How can I get this current position of the file?
</div>