Can anyone solve this? I have a websphere state table calling this function to check if one of these files are locked (I test with 'locki' most of the time) but everytime it says the file is locked. The file IS EMPTY, I made sure of that, when you CAT locki there is nothing printed at all. Maybe someone else has some ideas:
int isLocked(char privCode[1]){
FILE *in;
char fileName[38];
int result;
result=0;
fprintf(stderr, "\nthe value of result before we check lock: %d", result);
fflush(stderr);
if (privCode == "H")
strcpy(fileName, "/home/dtuser/rick/SMR/Export/lockh");
else
strcpy(fileName, "/home/dtuser/rick/SMR/Export/locki");
if ((in = fopen(fileName,"r")) == NULL)
result = 0; /*0 is not locked*/
else
result = 1; /*1 is locked*/
fclose(in);
strcpy(fileName, "");
return(result);
int isLocked(char privCode[1]){
FILE *in;
char fileName[38];
int result;
result=0;
fprintf(stderr, "\nthe value of result before we check lock: %d", result);
fflush(stderr);
if (privCode == "H")
strcpy(fileName, "/home/dtuser/rick/SMR/Export/lockh");
else
strcpy(fileName, "/home/dtuser/rick/SMR/Export/locki");
if ((in = fopen(fileName,"r")) == NULL)
result = 0; /*0 is not locked*/
else
result = 1; /*1 is locked*/
fclose(in);
strcpy(fileName, "");
return(result);