My code system includes an extensive library file written by someone else, which contains a number of function definitions etc. In the past, I've never had problems calling on this code. However, I have recently had to change PCs, and the new PC that I'm working on (which has Windows 7, compared to my previous PC that had XP) is resulting in errors that had never been present when using the identical code on my earlier PC.
Specifically, the straightforward code is
Code:
strcpy(filename, fileprefix);
strcat(filename, "outfile.out");
if ((refmap = fopen(filename,"w")) == NULL) {
fprintf(logfile,"Could not create outfile.out file.\n");
strcpy(error_msg,"Could not create outfile.out file.");
fclose(logfile);
return 1;
}
There should be nothing wrong with the above code. However, when I try to run my system, I invariably get the error message, "Could not create outfile.out".
I'm thinking that this may be a permissions issue.
When I right-click on my working folder, it shows that the folder & its subfolders are read-only. When I uncheck that box so that these *aren't* read-only and click Apply, the process seems to complete successfully, but then if I check this folder's properties again, it's back to being read-only.
My apologies that this isn't strictly a C programming question, but has anyone encountered such a problem? I've been told that it doesn't matter if this read-only box is checked, because I can still work with my files; however, this is the only explanation I have for why I wouldn't be able to create the outfile.out file. Any ideas about how to get my files to not be read-only? When I try to adjust the properties, I *am* already working in my Administrator account...
Any suggestions are welcome. Thanks in advance.