F
ferrad
I am trying to open a file for appending. ie. if the file exists, open
it for appending, if not, create it. I am getting back a NULL pointer,
and do not know why. Here is my code:
FILE *pFile;
char *cFileName;
cFileName=argv[++i];
pFile = fopen(cFileName,"a+");
cFileName has a valid filename ('apm.dbg'), and I have full write
permissions in the directory. I can step into fopen and when the file
is opened, I can see in another window that the file is created with
zero bytes. However pFile is returned as NULL.
Is there a function call I can make to tell what the error actually is?
it for appending, if not, create it. I am getting back a NULL pointer,
and do not know why. Here is my code:
FILE *pFile;
char *cFileName;
cFileName=argv[++i];
pFile = fopen(cFileName,"a+");
cFileName has a valid filename ('apm.dbg'), and I have full write
permissions in the directory. I can step into fopen and when the file
is opened, I can see in another window that the file is created with
zero bytes. However pFile is returned as NULL.
Is there a function call I can make to tell what the error actually is?