On Wed, Sep 23, 2020 at 10:25 AM Hesham Elhadad <helha...@gmail.com> wrote: > > Thanks Ian, > The root cause of this issue is not the hard drive, it is something with > overlapped offset and high offset values, need to be set to 0 to have a > smooth APPEND to the file. > I need to use /x/sys/windows package to call this function WriteFile(handle > Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error). > However, there is neither examples nor clarification on how to use or call > the function. Also, most of the function in this package using *int16/*int32 > for file names which is not clear to me if I want to use a string file name. > Appreciate any support you can provide, or guidance on a material which could > help.
Given a *os.File f that you can get using os.OpenFile, you can use f.SyscallConn to get a syscall.RawConn rc, and you can call rc.Write with a function literal that calls unix.WriteFile with the handle. Ian > On Tue, Sep 22, 2020 at 9:04 PM Ian Lance Taylor <i...@golang.org> wrote: >> >> On Tue, Sep 22, 2020 at 11:14 AM helhadad <helha...@gmail.com> wrote: >> > >> > Hi Folks, >> > I am trying to create file and write to it on a network mapped drive, >> > which I can access, create, delete and edit files using windows explorer >> > or CMD (Windows 10/Server 2016). >> > >> > You can find all details of the issue and response from other Go-Expert >> > below: >> > >> > https://stackoverflow.com/questions/63960049/writing-to-networked-mapped-drive-empty-files-or-failure >> > >> > I would appreciate if you enlighten me about the issue and how to solve it. >> >> According to Stack Overflow you are getting errors that say "the >> parameter is incorrect." If I search for "Windows the parameter is >> incorrect" all the top links are about reformatting the disk. So >> perhaps you should give that a try. >> >> 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXpQrAMaDKMRw1tPWjVMgdhR_OWgc9-aLf5kHHru_dttw%40mail.gmail.com.