Re: SMB CIFS AFP ETC... Server Path URL question
Re: SMB CIFS AFP ETC... Server Path URL question
- Subject: Re: SMB CIFS AFP ETC... Server Path URL question
- From: Jim Luther <email@hidden>
- Date: Fri, 10 Aug 2007 09:16:44 -0700
It looks like Quinn got you an answer before I saw this, so you can go
with his response.
I wrote the DisplayURL sample mostly to show how to use the low level
URL parsing routine CFURLGetByteRangeForComponent() to get individual
URL components after extracting the bytes of the CFURL with
CFURLCreateWithBytes(). Since you don't want the individual URL
components, it's not what you need.
- Jim
On Aug 9, 2007, at 6:35 PM, Daniel Brieck Jr. wrote:
Jim and all,
Should I be using objective-c to use the FSCopyURLForVolume()
function and others mentioned . Assuming that it is a function, it
looks very much like a C, C++ function. Is that a correct assumption?
I have been looking up how to use this function and was studying the
DisplayURL Sample code provided on ADC website. http://developer.apple.com/samplecode/DisplayURL/listing1.html
I have not had much luck with it since the Descriptions are minimal
in the Read Me and the .c file as to what the <path> is and what
the URL is exactly ?
I have tried running the command line program with the following
paths.
> ./DisplayURL -u "file://localhost/Volumes/MYVIDEOS/"
<Results>
url: "file://localhost/Volumes/MYVIDEOS/"
kCFURLComponentScheme: "file" including separators: "file://"
kCFURLComponentNetLocation: "localhost" including separators: "://
localhost"
kCFURLComponentPath: "/Volumes/MYVIDEOS/" including separators: "/
Volumes/MYVIDEOS/"
kCFURLComponentResourceSpecifier not found
kCFURLComponentUser not found
kCFURLComponentPassword not found
kCFURLComponentUserInfo not found
kCFURLComponentHost: "localhost" including separators: "://localhost"
kCFURLComponentPort not found
kCFURLComponentParameterString not found
kCFURLComponentQuery not found
kCFURLComponentFragment not found
I think this is the correct result and the extent of this program
> ./DisplayURL file://localhost/Volumes/MYVIDEOS/
<Result> Nothing
> ./DisplayURL "file://localhost/Volumes/MYVIDEOS/"
<Result> Nothing
But the Abstract on it did give me some hope mentioning the
"Server:" field
"
Abstract: DisplayURL gets the URL for a volume with
FSCopyURLForVolume, displays it, and
then uses CFURL routines to parse it into its various
components. The output of
server based files/folders is similar to the "Server:"
information displayed by
the "Get Info" window from within the Finder.
Example:
DisplayURL -u "scheme://user:pass@host:1/path/path2/
file.html;params?query#fragment"
"
But I am thinking that this DisplayURL program is not going to give
the path outright that I am looking for unless I pass it in to be
parsed in the first place or it will and I am not using the program
correctly.
In any case what would be the best course of action in terms of
documentation, reference, and topic to figure out how to use
FSCopyURLForVolume() .
Thank you,
Daniel J. Brieck Jr.
On Aug 6, 2007, at 11:42 AM, Jim Luther wrote:
Daniel,
I can't help you with the Finder AppleScript part of your question.
However...
To get the string it displays, the Finder first uses
FSCopyURLForVolume() to get a CFURLRef to the volume. Then, it
converts the CFURLRef to a CFStringRef with CFURLGetString().
- Jim
On Aug 6, 2007, at 8:19 AM, Daniel Brieck Jr. wrote:
Hello All,
I am currently in the process of writing a small Applescript
program and was running into trouble trying to find a way to
access the actual SMB, CIFS, AFP paths (URLs) as they are listed
in the Finders' "Get Info" window for a selected Network volume.
I am trying to read the Server: field and save it as a variable
for a particular mounted network volume. I have a feeling that
this may not be a "value" that is easily accessible with
AppleScript. Since I could not find any info on it from ADC
documents and the AppleScript mailing list as of yet. Does anyone
have any suggestions on what could be use to read that Server
field.
Here is the Get info window for the network drive showing a Server
path that I would like to find a way to accesses in a read only
fashion. https://cms.psu.edu/AngelUploads/Files/djb376/Get_Info.png
Again the string I am trying to read into a variable is this:
"cifs://MSHOME;DANIELBR@IBM_NETVISTA/MYVIDEOS"
Thank you,
Daniel J. Brieck Jr.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden