Re: [go-nuts] how to get file's current offset

2019-04-19 Thread andrey mirtchovski
On Fri, Apr 19, 2019, 4:48 PM Rob Pike  wrote:

> I just use 1 so I don't have to look up what it's called these days, but
> I'm seriously old school.
>

Does that pass code review or do people give you the benefit of doubt?

>

-- 
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.


Re: [go-nuts] how to get file's current offset

2019-04-19 Thread Rob Pike
I just use 1 so I don't have to look up what it's called these days, but
I'm seriously old school.

-rob


On Sat, Apr 20, 2019 at 3:19 AM Michael Jones 
wrote:

> I’ve been doing that since 6th Edition, 1976/77
>
> On Thu, Apr 18, 2019 at 8:00 AM andrey mirtchovski 
> wrote:
>
>> > offset, err := f.Seek(0, io.SeekCurrent)
>>
>> my code has been written so long ago i didn't even notice os.SEEK_CUR
>> is deprecated :)
>>
>> --
>> 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.
>>
> --
>
> *Michael T. jonesmichael.jo...@gmail.com *
>
> --
> 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.
>

-- 
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.


Re: [go-nuts] how to get file's current offset

2019-04-19 Thread Michael Jones
I’ve been doing that since 6th Edition, 1976/77

On Thu, Apr 18, 2019 at 8:00 AM andrey mirtchovski 
wrote:

> > offset, err := f.Seek(0, io.SeekCurrent)
>
> my code has been written so long ago i didn't even notice os.SEEK_CUR
> is deprecated :)
>
> --
> 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.
>
-- 

*Michael T. jonesmichael.jo...@gmail.com *

-- 
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.


Re: [go-nuts] how to get file's current offset

2019-04-18 Thread andrey mirtchovski
> offset, err := f.Seek(0, io.SeekCurrent)

my code has been written so long ago i didn't even notice os.SEEK_CUR
is deprecated :)

-- 
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.


Re: [go-nuts] how to get file's current offset

2019-04-18 Thread Valentin Vidic
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/")
>   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.


Re: [go-nuts] how to get file's current offset

2019-04-18 Thread andrey mirtchovski
offset, err := f.Seek(0, os.SEEK_CUR)

On Thu, Apr 18, 2019 at 8:50 AM  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/")
> if err != nil{
> panic(err)
> }
>
> ... // some read operation
>
> // how can I get f's current read offset??
>
> --
> 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.

-- 
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.


[go-nuts] how to get file's current offset

2019-04-18 Thread sa517067
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/")
if err != nil{
panic(err)
}

... // some read operation
 
// how can I get f's current read offset?? 

-- 
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.