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 to rename the volume name of a USB flash memory stick?



On Nov 30, 2005, at 1:23 PM, Ben Zhu wrote:
Yes, I can see it from the debugger. It is "\000ewName".

The actual name becomes the "ewName" in the Finder after calling rename(..).

I've tried HRename on 10.4.3, on a Mac OS Extended ("HFS+") disk and an MS-DOS (FAT32) disk image, and it's working fine for me:



// g++ -framework Carbon -fpascal-strings test.cp

#include <Carbon/Carbon.h>

int main()
{
        int vRefNum = -106;  // see below
        Debugger();

printf("HRename error = %d\n", ::HRename(vRefNum, 0, NULL, "\pNewName"));
return 0;
}



For my experiment, I was stopping at Debugger() in gdb and using: call (void) PrintVolumeInfo() ...to see a list of all the valid vRefNum values.

If you're still having the problem, please post the code that sets up the HRename call.

--Dave

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

This email sent to email@hidden
References: 
 >RE: How to rename the volume name of a USB flash memory stick? (From: "Ben Zhu" <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.