Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1021679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:20:46+00:00 2026-05-16T11:20:46+00:00

I am not very proficient in Mac OS X programming, but I am working

  • 0

I am not very proficient in Mac OS X programming, but I am working on a Qt application which needs info about the storage devices. Basically a list of hard drives and USB thumb drives.
The end result should be like a vector which contains the following info for each device:

string: Label
string: Mount point
string: Device description (aka friendly name)
uint64: Size
bool: Is removable?

I’ve been doing it on Windows and the following post Get information about disk drives result on windows7 – 32 bit system have been of a great help. However, although I am very proficient in C/C++ I am not really good in Mac OS X programming, Cocoa and/or Objective-C, so any help would be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:20:47+00:00Added an answer on May 16, 2026 at 11:20 am

    This should get you most of what you’re looking for:

    NSWorkspace   *ws = [NSWorkspace sharedWorkspace];
    NSArray     *vols = [ws mountedLocalVolumePaths];
    NSFileManager *fm = [NSFileManager defaultManager];
    
    for (NSString *path in vols) 
    {
        NSDictionary* fsAttributes;
        NSString *description, *type, *name;
        BOOL removable, writable, unmountable, res;
        NSNumber *size;
    
        res = [ws getFileSystemInfoForPath:path 
                               isRemovable:&removable 
                                isWritable:&writable 
                             isUnmountable:&unmountable
                               description:&description
                                      type:&type];
        if (!res) continue;
        fsAttributes = [fm fileSystemAttributesAtPath:path];
        name         = [fm displayNameAtPath:path];
        size         = [fsAttributes objectForKey:NSFileSystemSize];
    
        NSLog(@"path=%@\nname=%@\nremovable=%d\nwritable=%d\nunmountable=%d\n"
               "description=%@\ntype=%@, size=%@\n\n",
              path, name, removable, writable, unmountable, description, type, size);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not very familiar in programming databases, but I have a Mysql-Database which I
I'm not very proficient with AJAX but by all accounts I think this should
Not very technical, but... I have to implement a bad words filter in a
I am not very good with Regex but I am learning. I would like
I've come up with: re.findall(([a-fA-F\d]*), data) but it's not very fool proof, is there
I'm in the process of setting up a php project, but am not very
I am not very familiar with Regular expression, but I am asked to modify
I'm not very 'up' on multi-threading, but I've been using detachNewThreadSelector in a couple
the title might be not very descriptive but i couldn't think of a better
I'm not very good at C, and I always get stuck on simple string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.