Hi,
I guess in every beginners C-book it writes about how to declare a
filepointer fp and how to create a file (at least in mine)...... Like here:
FILE * fp;
fp = fopen("output_f ile.txt", "w");
if( fp == NULL)
{
printf("Error: File could not be opened\n");
return 1;
}
....
....
But now I would like to test if a given directory exists and if not, I
want to create it so I can put data-files in that sub-directory... How
to do that? And why is that I guess many text-books don't discuss how to
do this?
Best regards / Med venlig hilsen
Martin Jørgensen
--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk
I guess in every beginners C-book it writes about how to declare a
filepointer fp and how to create a file (at least in mine)...... Like here:
FILE * fp;
fp = fopen("output_f ile.txt", "w");
if( fp == NULL)
{
printf("Error: File could not be opened\n");
return 1;
}
....
....
But now I would like to test if a given directory exists and if not, I
want to create it so I can put data-files in that sub-directory... How
to do that? And why is that I guess many text-books don't discuss how to
do this?
Best regards / Med venlig hilsen
Martin Jørgensen
--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk
Comment