The FILE * p [56];
Int I;
AnsiString STR.
for(i=0; i<56. I++)
{
STR=IntToStr (I) + ". TXT ".
If ((p [I]=fopen (STR) c_str (), "wt"))
==NULL)
{
ShowMessage (STR);
return ;
}
}
STR=STR + "complete";
ShowMessage (STR);
Find the can only open the 47 file,
masters excuse me, where it is to limit the?
Can remove this restriction?
thank you
CodePudding user response:
Check the error code, or use CreateFile try again, can also open hundreds of documents are no problem beforeCodePudding user response:
Check, whether to open or lock the file has been other programsCodePudding user response:
Function: open a fileFunction prototypes: the FILE * fopen (const char * path, const char * mode).
Related functions: open, fclose, fopen_s [1], _wfopen
The library: & lt; stdio.h>
Return value: file on the smooth, pointing to the current file pointer will be returned, if the file open failed it returns NULL, and the error code to exist error,
Use getlasterror read to see what is wrong
CodePudding user response:
Join the following statement:
Error=GetLastError ();
The return value error=183;
(183) - when the file already exists, unable to create the file,
But there is no 47. TXT this file exists? How can't create?
CodePudding user response:
Come look ha ha thank youCodePudding user response:
Try using a set of file name?CodePudding user response:
Name change also not line,I tried the following code:
for(i=0; i<56. I++)
{
STR="FileNumber" + IntToStr (I) + ". TXT ".
If ((p [I]=fopen (STR) c_str (), "wt"))
==NULL)
{
Error=GetLastError ();
ShowMessage (STR);
return ;
}
fclose (p [I]) .
}
STR=STR + "complete";
ShowMessage (STR);
When combined with fclose (p [I]), you can open the 55 file
That name should do not have what problem?
Is the limit where there is a maximum at the same time open the file,
Masters: you, please give some advice? thank you
CodePudding user response:
Check the C: \ WINDOWS \ system32 \ CONFIG NT set up inside to see?CodePudding user response:
_getmaxstdio obtain maximum number of open file_setmaxstdio set the maximum number of open files
CodePudding user response: