问题
Is it possible to open files on Samba shares using C++ IO streams in Linux as transparently as on Windows using just UNC path (or similar) or do I always need some kind of 3rd party library?
If a 3rd party library is the only solution, what 3rd party libraries are there for Samba shares access?
回答1:
It looks like you just want to mount the remote server using cifsfs (see "man mount.cifs"), and then access the files from the mount point you specified.
There is no way that you can explicitly specify a UNC path or anything like that directly to standard file system API (on top of which std::fstream operates).
来源:https://stackoverflow.com/questions/11381143/transparent-access-to-files-on-samba-shares-on-linux-et-al-using-c-io-streams