I am running into an issue getting the full url for a file with FSCopyURLForVolume
. I am using the code from this issue Determine AFP share from a file URL but it isn't giving me the full url. For example:
With a path like: /Volume/server/html/index.html
All I get back is url to the base mount: nfs://real_server_name/vol
Leaf directories and the file names are left off, the full path is available in the files info so there has to be a way to get this information.
EDIT:
After some more digging is seems like I want to use kFSCatInfoParentDirID
and kFSCatInfoNodeID
to get the parent and node(file) id but I'm not sure how to turn this into something useful.
because the FSPathMakeRef, FSGetCatalogInfo and FSCopyURLForVolume are deprecated from Mac OS X 10.8 I modernised the code for get UNC network path on Mac OS X mounted volumes.
The result is in my case, Path: smb://FRANCESCO@192.168.69.44/SCAMBIO/testreport.exe
You need to specify your network mapped volume.
ciao.
A solution to this problem was suggested on the Apple Dev Forums, here is the final function I came up with: