mvo5 / libsmbclient-go

Go bindings for libsmbclient
MIT License
18 stars 11 forks source link

Question #1

Closed cdujeu closed 4 years ago

cdujeu commented 8 years ago

Hi Michael, Just a quick question, did you recently test this code? I'm trying to make it run, but with the basic tests you provide (and querying properly configured smb shares, simple smbclient calls are working), i always get errors. For example, trying openSmbDir, I always get an error string saying "file exists". Any hints? thanks a lot in advance and best regards, Charles

mvo5 commented 8 years ago

On Fri, Aug 26, 2016 at 03:47:02AM -0700, Charles du Jeu wrote:

Hi Michael, Hi Charles,

Just a quick question, did you recently test this code? I'm trying to make it run, but with the basic tests you provide (and querying properly configured smb shares, simple smbclient calls are working), i always get errors. For example, trying openSmbDir, I always get an error string saying "file exists". Any hints?

I have not used that in a long time, the fact that it all need to be serialized was a big disappointment (internally libsmbclient is not thread safe). I can have a look again but that it will take a couple of days (sorry).

Cheers and good luck, Michael

thanks a lot in advance and best regards, Charles

You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/mvo5/libsmbclient-go/issues/1

dhubler commented 5 years ago

I'm getting "file exists" error as well. Problem is this is for READ operations so "file exists" doesn't make sense in that context. I'm researching how to allow this exact error on read operations and looking to submit PR.

On a larger and separate note, original author(mvo5) alluded to being being disappointed about implementing a global lock because underlying library (libsmbclient) is not threadsafe. I assume this means performance issues in concurrent environments. Has anyone found a way around this? Is anyone still using this library, it has been 6 years since a commit has been made.

dhubler commented 5 years ago

While this is a very different approach, I did find https://github.com/cloudfoundry/smb-volume-release any thoughts?

mvo5 commented 5 years ago

Hey @dhubler - thanks for looking into what the problem might be. I would love to see a PR as I think the code may still be useful for people.

On the thread-safe issue. It is a performance issue in the sense that all operations need to be serialized. (iirc, this has been a while) This means that a file read need to be finished or cancelled before another operation can take place. My original use-case was a server app that would perform many operations so there this was very problematic. However for e.g. a CLI or GUI app that is used by a single user this may not matter.