On Thu, Apr 18, 2019 at 10:34:24PM +0800, sa517...@mail.ustc.edu.cn wrote:
> I want to know file's current read offset after open a file, but I can not 
> found related API.
>       
>         f, err := os.Open("/tmp/xxxx")
>       if err != nil{
>               panic(err)
>       }
> 
>         ... // some read operation
>          
>         // how can I get f's current read offset?? 

offset, err := f.Seek(0, io.SeekCurrent)

-- 
Valentin

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to