why fopen returns null,is there any specific reason
fopen() in c returns null
Collapse
X
-
HI,
In which mode r u opening the file
Check the path of the file,being passed as argument
This may be the reason , for which fopen returns null
Thanks
Raghuram -
Originally posted by gpraghuramHI,
In which mode r u opening the file
Check the path of the file,being passed as argument
This may be the reason , for which fopen returns null
Thanks
Raghuram
Hi,
I am opening file in write mode.Path contains a very big string.
Several files were copied into the same path,but suddenly for one of the file
it is not able to write into the same path
Thanks,
srilakshmiComment
-
Hi,
I think there is a restriction to path size of 260 characters.(I am not very sure abt this)
Check for the failing fopen the path is greater than 260 characters.
This value is in stdio.h
Thanks
RaghuramComment
-
Also, dont' forget that if the file isn't there or fopen() can't open it, it will return null as well. You should always check after you open a file, to see if it returned null or the actual file pointer.Originally posted by gpraghuramHI,
In which mode r u opening the file
Check the path of the file,being passed as argument
This may be the reason , for which fopen returns null
Thanks
RaghuramComment
-
fopen() in write mode will create the file if it doesn't exist.Originally posted by ilikepythonAlso, dont' forget that if the file isn't there or fopen() can't open it, it will return null as well.Comment
-
Yep, that is also true.Originally posted by Silent1Mezzofopen() in write mode will create the file if it doesn't exist.Comment
Comment