• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
statfs - results vary - why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

statfs - results vary - why?


  • Subject: statfs - results vary - why?
  • From: Steve Cronin <email@hidden>
  • Date: Sat, 27 Aug 2005 16:24:18 -0500

Folks;

I'm still pretty new to Cocoa so I apologize if this has bone-head written all over it.

I trying to build a reliable (refresh-able) mechanism which scans mounted volumes.
I want to handle smb mounts differently from webdav or nfs mounts.


I do something like this:
NSArray *t = [NSArray arrayWithArray:[[NSWorkspace sharedWorkspace] mountedLocalVolumePaths]];
z = [t count]-1;
for (i=0; i < z; ++i) {
statfs( [[t objectAtIndex:i] cString], &b);
volumesDictionary = [NSMutableDictionary dictionary];
[volumesDictionary setObject:[NSString stringWithCString:b.f_fstypename] forKey:@"fsType"];
[volumesDictionary setObject:[NSString stringWithCString:b.f_mntonname] forKey:@"fsMountOn"];
[volumesDictionary setObject:[NSString stringWithCString:b.f_mntfromname] forKey:@"fsMountFrom"];
[volumesArray addObject:volumesDictionary];
......


On applicationDidFinishLaunching this works dandy!
I get all the volumes and the fsType is what I expect {hfs, smbfs, msdos webdav..}.


BUT if, after the application has launched, I mount a volume and then re-fresh my volumeList I never get the right results.
Everything seems to be marked nfs.


I know there are things about the automount daemon I don't understand so any pointers there would be really appreciated.

What I really don't get is: why, if I simply quit and re-launch my application, I then DO get the right results!! Huh?

Steve


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Core Data Smart groups and manual groups
  • Next by Date: jni and core foundation classes
  • Previous by thread: Core Data Smart groups and manual groups
  • Next by thread: jni and core foundation classes
  • Index(es):
    • Date
    • Thread