Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I get Hard Disks(ATA) and Removable media(USB) attached to my system??



Hi,

You might want to check out Disk Arbitration.

#include <DiskArbitration/DiskArbitration.h>

void callback( DADiskRef disk, void * context )
{
    CFDictionaryRef description;

    description = DADiskCopyDescription( disk );

    if ( description )
    {
        CFShow( description );

        CFRelease( description );
    }
}

int main( )
{
    DASessionRef session;

    session = DASessionCreate( kCFAllocatorDefault );

if ( session )
{
DASessionScheduleWithRunLoop( session, CFRunLoopGetCurrent ( ), kCFRunLoopDefaultMode );


DARegisterDiskAppearedCallback( session, kDADiskDescriptionMatchMediaWhole, callback, NULL );

        CFRunLoopRun( );

DASessionUnscheduleFromRunLoop( session, CFRunLoopGetCurrent ( ), kCFRunLoopDefaultMode );

        CFRelease( session );
    }

    return 0;
}

Dan

On 2 Sep 2005, at 5:30 AM, darpan kamboj wrote:

Hi all

I want to get the Hard disks and Removable media attached to my system and capacity of disks. Actually i want to raw read the hard disk. Currently i am picking the hard disks from "/dev/disk*" here * may be 1,2,3 depending upon the hard disks attached to system.

My problem is :
1) In case OS installed in any other language other than english then i am not able to pick the hard disks.


2) I am not able to get capacity of hard disks.

3) I am not able to differenciate whether this is removable media or hard disk.

How I can get hard disks attached,capacity,Serial no. of hard disks so that i can raw read the hard disk.


Thanks and Regards

_________________________________________________________________
Job hunting? Get the right one! http://creative.mediaturf.net/ creatives/timesjobs/hotmail_TOL.htm Log on to timesjobs TODAY


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Ata-scsi-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/ata-scsi-dev/markarian% 40apple.com


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Ata-scsi-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/ata-scsi-dev/email@hidden

This email sent to email@hidden
References: 
 >How can I get Hard Disks(ATA) and Removable media(USB) attached to my system?? (From: "darpan kamboj" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.