KCMS CMM Developer's Guide

Saving a Profile to a Different Description

To save a profile to a different description, load a new KcsIO so that the KcsProfile object can save itself. This is accomplished with the same mechanism as that described in steps 2 to 5 of "Creating a KcsIO Object". Example 3-11 is a KCMS "C" API code excerpt that saves a profile to a different description.


Example 3-11 Saving a Profile to a Different Description

/* Application opens the file */ 
if ((sfd = open(argv[2], O_RDWR|O_CREAT, 0666)) == -1) {
     perror ("save open failed");
     exit (1); 
}  

desc.type = KcsFileProfile;
desc.desc.file.openFileId = sfd; 
desc.desc.file.offset = 0; 
status = KcsSaveProfile(profileid, &desc); 
if(status != KCS_SUCCESS) {
     status = KcsGetLastError(&errDesc);
     printf("SaveProfile error: %s\n", errDesc.desc); 
}