c++ (problem)

Programovacie jazyky, rady, poradňa...
smutko8882
Light Expert
Light Expert
Príspevky: 65
Registrovaný: 29 okt 2006, 18:25

c++ (problem)

Príspevok od používateľa smutko8882 »

Tak napisal som si zdrojacik na zistenie nazvu suborov z adresara

#include <errno.h>
#include <io.h>
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
DIR *pdir;
FILE *f;
struct dirent *pent;

f=fopen("d:\nazvy.txt","w");
pdir=opendir("d:\A"); //"." refers to the current dir
if (!pdir){
printf ("opendir() failure; terminating");
exit(1);
}
errno=0;
while ((pent=readdir(pdir))){
fprintf(f,"%s\n", pent->d_name);
printf ("%s",pent->d_name);
}
if (errno){
printf ("readdir() failure; terminating");
exit(1);
}
closedir(pdir);

a mam taky problem ze nedokaze nacitat viac ako 8 znakov ... neviete poradit jak by sa dal tento problem riesit ???
Napísať odpoveď