What are you using to get the disk names? The home and net disks are placeholders for networked volumes, and can't be deleted.
Code of listing the drive is the following:
#Define MAX_LIST_DRIVE_NUM 50
DriveNameInfo driveList[MAX_LIST_DRIVE_NUM ];
memset(driveList, 0 , sizeof(driveList));
OSErr result = noErr;
int volumeIndex = 0;
FSVolumeRefNum refNum;
HFSUniStr255 volumeName;
UInt16 nameLen = 0;
for(volumeIndex = 1; result == noErr ; volumeIndex++)
{
result = FSGetVolumeInfo(kFSInvalidVolumeRefNum,
volumeIndex,
&refNum,
kFSVolInfoNone,
NULL,
&volumeName,
NULL);
if(result == noErr )
{
//get the drive's info
CFStringRef volumeNameRef = CFStringCreateWithCharactersNoCopy(
kCFAllocatorDefault,
volumeName.unicode,
volumeName.length,
kCFAllocatorDefault);
//get the drive's name
CFStringGetFileSystemRepresentation(volumeNameRef,
driveList[voluneIndex -1].name,
NAME_MAX);
//Save length of the drive's name
nameLen = volumeName.length < strlen(driveList[volumeIndex - 1].name) ? strlen(driveList[volumeIndex - 1].name) : volumeName.length;
driveList[volumeIndex - 1].nameLen = CFSwapInt16HostToLittle(nameLen);
//Fil in the attribute
driveList[volumeIndex - 1].attribute = CFSwapInt16HostToLittle('l');
}
}
How to control the code or other methods not to list the home and net drive?