Programmatically interact with samba server.

Is there an API for interacting with SAMBA server?


Can I upload and download files via SMB protocol by using NSURLConnection?


My current solution is getting samba sources, build libsmbclient from them, and use it.


But is there a simplest solution? What library is using by Finder?

Answered by DTS Engineer in 252305022

For MacOSX.

OK.

Is there something like CFFTP or CFHTTP API for SMB protocol?

No.

How does Finder app interact with SMB file shares?

There’s two parts to this:

  • For volume management, Finder uses a selection of complex frameworks for browsing and mounting SMB volumes. Most of those frameworks are private (the exception being NetFS).

  • For actual I/O, Finder uses file system APIs. These requests are translated into the SMB on-the-wire protocol via the SMB VFS plug-in.

You could mount the SMB volume such that it’s not shown to the user and then use file system APIs to access it, but that’s a rather heavyweight solution. Then again, maintaining your own SMB client code is also rather heavyweight.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Is there an API for interacting with SAMBA server?

On what platform?

Can I upload and download files via SMB protocol by using NSURLConnection?

No.

Note You shouldn’t be using NSURLConnection because it’s been deprecated in favour of NSURLSession. Not that this makes a difference in this case because NUSRLSession has no SMB support either.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

On what platform?

For MacOSX.


Is there something like CFFTP or CFHTTP API for SMB protocol?

How does Finder app interact with SMB file shares?

Accepted Answer

For MacOSX.

OK.

Is there something like CFFTP or CFHTTP API for SMB protocol?

No.

How does Finder app interact with SMB file shares?

There’s two parts to this:

  • For volume management, Finder uses a selection of complex frameworks for browsing and mounting SMB volumes. Most of those frameworks are private (the exception being NetFS).

  • For actual I/O, Finder uses file system APIs. These requests are translated into the SMB on-the-wire protocol via the SMB VFS plug-in.

You could mount the SMB volume such that it’s not shown to the user and then use file system APIs to access it, but that’s a rather heavyweight solution. Then again, maintaining your own SMB client code is also rather heavyweight.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Programmatically interact with samba server.
 
 
Q