Thank you. I completely got both the programs wrong by interchanging the 
parameters.

Thank you for pointing it out.

On Tuesday 9 April 2024 at 03:27:00 UTC+5:30 Bakul Shah wrote:

> >         offset, err := f.Seek(0, 10)
>
> The second argument needs to be one of io.{SeekStart,SeekCurrent,SeekEnd} 
> (0, 1 or 2).
> go doc os.File.Seek
>
> On Apr 8, 2024, at 2:24 PM, Nikhilesh Susarla <nikhil...@gmail.com> wrote:
>
> github/file-seek/main.go 
> <https://github.com/susarlanikhilesh/file-seek-failure/blob/main/main.go>
>
> I did write with ReadOnly also and it failed. 
>
> Sorry, I assumed both Append and ReadOnly fails.
>
> On Tuesday 9 April 2024 at 02:14:48 UTC+5:30 Ian Lance Taylor wrote:
>
>> On Mon, Apr 8, 2024, 3:33 PM Nikhilesh Susarla <nikhil...@gmail.com> 
>> wrote:
>>
>>> I wanted to seek around a file by opening it using read-only, but then I 
>>> get this error called "Invalid argument"
>>>
>>> https://go-review.googlesource.com/c/go/+/14881
>>>
>>> I read the above link and they say it is not supported to seek around. I 
>>> tried direct lseek in c language and it failed with same. 
>>>
>>> Is there any way ?
>>>
>>
>> What that link says is that if you open the file with O_APPEND then you 
>> can't Seek.  Are you opening with O_APPEND?
>>
>> If not you will need to provide more information, such as a small program 
>> that demonstrates the problem.
>>
>> Ian
>>
>>>
> -- 
> 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...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/536e18e8-4dd3-44a4-8893-d5fa22836996n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/golang-nuts/536e18e8-4dd3-44a4-8893-d5fa22836996n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/30c22811-676a-4054-9c91-c35e1dfc425en%40googlegroups.com.

Reply via email to