C H A P T E R 3

Working with Records

dirStatus = dsOpenRecord( nodeRef, recType, recName, &recRef ); if ( dirStatus == eDSNoErr )

{

dirStatus = dsDeleteRecord( recRef ); if (dirStatus != eDSNoErr)

{

//The record was not deleted, so close it. dirStatus = dsCloseRecord( recRef );

}

recRef = NULL;

}

dsDataNodeDeAllocate( gDirRef, recType ); recType = NULL;

}

dsDataNodeDeAllocate( gDirRef, recName ); recName = NULL;

}

} // DeleteRecord

Note that for this example to work, it would have to be run by a root process on the local NetInfo domain, or by a user process that has called dsDoDirNodeAuth with the inDirNodeAuthOnlyFlag parameter set to FALSE to get permission to make this change.

42Deleting a Record

2007-01-08 © 2007 Apple Inc. All Rights Reserved.

Page 42
Image 42
Apple OS X manual Working with Records