From: SpreadTooThin on
I am trying to mount a drive from within my C application.
It would appear that in order to mount a volume I must use the
mount(2) command from within my C code.

However the man page isn't very informative on the parameters passed
to the command....

Imagine I want to mount afp://user:password(a)host/dir

How would I format the mount command in C to do this?

From: Doug McIntyre on
SpreadTooThin <bjobrien62(a)gmail.com> writes:
>I am trying to mount a drive from within my C application.
>It would appear that in order to mount a volume I must use the
>mount(2) command from within my C code.

>However the man page isn't very informative on the parameters passed
>to the command....

>Imagine I want to mount afp://user:password(a)host/dir

>How would I format the mount command in C to do this?


You know, the Darwin source code is all online.. You could lookup to
see how Apple does it.. :)

I couldn't find the specific code that mounts afp: mounts in my quick
browsing of the source code though.

You could start here perhaps.

http://www.opensource.apple.com/source/diskdev_cmds/diskdev_cmds-421.8/mount.tproj/mount_ufs.c

And continue browsing around.
From: John Gordon on
In <93ff862d-7a2b-4f35-a37e-af28bfd74f9c(a)11g2000prv.googlegroups.com> SpreadTooThin <bjobrien62(a)gmail.com> writes:

> I am trying to mount a drive from within my C application.
> It would appear that in order to mount a volume I must use the
> mount(2) command from within my C code.

> However the man page isn't very informative on the parameters passed
> to the command....

> Imagine I want to mount afp://user:password(a)host/dir

Is that a local device, or a directory on a remote system?

If it's remote, I'm not sure mount(2) is the appropriate function to use.

--
John Gordon A is for Amy, who fell down the stairs
gordon(a)panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

From: SpreadTooThin on
On May 25, 3:33 pm, John Gordon <gor...(a)panix.com> wrote:
> In <93ff862d-7a2b-4f35-a37e-af28bfd74...(a)11g2000prv.googlegroups.com> SpreadTooThin <bjobrie...(a)gmail.com> writes:
>
> > I am trying to mount a drive from within my C application.
> > It would appear that in order to mount a volume I must use the
> > mount(2) command from within my C code.
> > However the man page isn't very informative on the parameters passed
> > to the command....
> > Imagine I want to mount afp://user:password(a)host/dir
>
> Is that a local device, or a directory on a remote system?
>

Remote for sure!


> If it's remote, I'm not sure mount(2) is the appropriate function to use.
>
> --
> John Gordon                   A is for Amy, who fell down the stairs
> gor...(a)panix.com              B is for Basil, assaulted by bears
>                                 -- Edward Gorey, "The Gashlycrumb Tinies"

From: Barry Margolin on
In article
<93ff862d-7a2b-4f35-a37e-af28bfd74f9c(a)11g2000prv.googlegroups.com>,
SpreadTooThin <bjobrien62(a)gmail.com> wrote:

> I am trying to mount a drive from within my C application.
> It would appear that in order to mount a volume I must use the
> mount(2) command from within my C code.
>
> However the man page isn't very informative on the parameters passed
> to the command....
>
> Imagine I want to mount afp://user:password(a)host/dir
>
> How would I format the mount command in C to do this?

The man page doesn't give much information because the type and contents
of the data parameter depend on the filesystem type. Unfortunately,
there don't seem to be man pages in OS X for the filesystem drivers,
which is where I'd expect the type-specific details to be.

--
Barry Margolin, barmar(a)alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***