hirochachacha / go-smb2

SMB2/3 client library written in Go.
BSD 2-Clause "Simplified" License
350 stars 94 forks source link

Share.Remove erratic behaviour #80

Closed palevi67 closed 1 year ago

palevi67 commented 1 year ago

When trying to remove a file with Share.Remove, I get random errors or panics:

and the file never gets removed. I'm testing this using a share in my windows11 development machine.

    f := "pablo\\tmp\\compartida\\kk.resultados"
    err = smb.smbShare.Remove(f)
    if err != nil {
        panic(err)
    }
palevi67 commented 1 year ago

Sorry! this was caused by a race condition caused by a close() on other go routine. I've added a mutex and now is working as expected ...