FROM : Ryan Britton
DATE : Wed Jun 21 17:47:34 2006
Assuming you can mount it yourself using something like this...
CFURLRef url;
CFStringRef user;
CFStringRef password;
//Set these to something
FSVolumeRefNum mountReference;
OSStatus result = FSMountServerVolumeSync(url, NULL, user, password,
&mountReference, 0);
Then you can get the mount path using this...
FSRef volPathRef;
OSErr err = FSGetVolumeInfo(mountReference, 0, NULL, kFSVolInfoNone,
NULL, NULL, &volPathRef);
On Jun 21, 2006, at 8:18 AM, Aalok wrote:
> Thank you for you response.
>
> I actually mean the drive is mounted under different name. If you can
> not relay on the name under /Volumes, can you please suggest me the
> way to get the reference (or path) of the mounted drive
> programatically?
>
> "To save away a reference to a volume, use an AliasHandle" I dont
> understand this stmt.
>
> regards,
>
> aalok
>
>
> On 6/21/06, Uli Kusterer <<email_removed>> wrote:
>> Am 20.06.2006 um 16:46 schrieb Aalok:
>> > The problem is, sometimes
>> > (I acutally cannot figure out when exactly) the drive is mounted
>> with
>> > an aliases. This creates problem in my program as i use the fix
>> path.
>>
>> > One more thing I observed is, under /Volumes the original mount
>> name
>> > is still present. If I do "rm -r" on that directory the mounting
>> > starts working properly again with original directory name as mount
>> > name. (eg, if I mount drive with name "music" in /Volumes it comes
>> > /Volumes/music. But when aliase is created, /Volumes/music still
>> > remains there and /Volumes/music1 is created automatically.
>> Though in
>> > finder it show "music" as mounted name.)
>>
>> I don't really understand what you're trying to do and where
>> Aliases come in in your problem. Do you mean an AliasHandle or an
>> Alias file? Or do you simply mean it's mounted under a different
>> name? Just in case you didn't come across this in the docs: You *can
>> not* rely on a drive showing up under /Volumes with the actual drive
>> name. There can be several mounted volumes with the same name, and
>> then they'll show up under /Volumes with names like name1 and name2.
>> That's by design.
>>
>> Paths in /Volumes are transient. Don't save them away, don't expect
>> them to stay the same between launches of your application, or across
>> restarts, or the second time a volume is mounted after it's been
>> unmounted. Ideally, you would get the drive's path from the mount
>> notification NSWorkspace sends you, or if you mount it yourself,
>> there should be a way to get it from the API you use to mount the
>> drive.
>>
>> To save away a reference to a volume, use an AliasHandle.
>>
>> Cheers,
>> -- M. Uli Kusterer
>> http://www.zathras.de
>>
>>
>>
>
>
> --
> Tata Consultacy Services
> Voice:- (091) 9850984395
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
DATE : Wed Jun 21 17:47:34 2006
Assuming you can mount it yourself using something like this...
CFURLRef url;
CFStringRef user;
CFStringRef password;
//Set these to something
FSVolumeRefNum mountReference;
OSStatus result = FSMountServerVolumeSync(url, NULL, user, password,
&mountReference, 0);
Then you can get the mount path using this...
FSRef volPathRef;
OSErr err = FSGetVolumeInfo(mountReference, 0, NULL, kFSVolInfoNone,
NULL, NULL, &volPathRef);
On Jun 21, 2006, at 8:18 AM, Aalok wrote:
> Thank you for you response.
>
> I actually mean the drive is mounted under different name. If you can
> not relay on the name under /Volumes, can you please suggest me the
> way to get the reference (or path) of the mounted drive
> programatically?
>
> "To save away a reference to a volume, use an AliasHandle" I dont
> understand this stmt.
>
> regards,
>
> aalok
>
>
> On 6/21/06, Uli Kusterer <<email_removed>> wrote:
>> Am 20.06.2006 um 16:46 schrieb Aalok:
>> > The problem is, sometimes
>> > (I acutally cannot figure out when exactly) the drive is mounted
>> with
>> > an aliases. This creates problem in my program as i use the fix
>> path.
>>
>> > One more thing I observed is, under /Volumes the original mount
>> name
>> > is still present. If I do "rm -r" on that directory the mounting
>> > starts working properly again with original directory name as mount
>> > name. (eg, if I mount drive with name "music" in /Volumes it comes
>> > /Volumes/music. But when aliase is created, /Volumes/music still
>> > remains there and /Volumes/music1 is created automatically.
>> Though in
>> > finder it show "music" as mounted name.)
>>
>> I don't really understand what you're trying to do and where
>> Aliases come in in your problem. Do you mean an AliasHandle or an
>> Alias file? Or do you simply mean it's mounted under a different
>> name? Just in case you didn't come across this in the docs: You *can
>> not* rely on a drive showing up under /Volumes with the actual drive
>> name. There can be several mounted volumes with the same name, and
>> then they'll show up under /Volumes with names like name1 and name2.
>> That's by design.
>>
>> Paths in /Volumes are transient. Don't save them away, don't expect
>> them to stay the same between launches of your application, or across
>> restarts, or the second time a volume is mounted after it's been
>> unmounted. Ideally, you would get the drive's path from the mount
>> notification NSWorkspace sends you, or if you mount it yourself,
>> there should be a way to get it from the API you use to mount the
>> drive.
>>
>> To save away a reference to a volume, use an AliasHandle.
>>
>> Cheers,
>> -- M. Uli Kusterer
>> http://www.zathras.de
>>
>>
>>
>
>
> --
> Tata Consultacy Services
> Voice:- (091) 9850984395
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Aalok | Jun 20, 16:46 | |
| Uli Kusterer | Jun 21, 16:42 | |
| Aalok | Jun 21, 17:18 | |
| Ryan Britton | Jun 21, 17:47 |






Cocoa mail archive

