Pomoc pri programovani v C
Pavel JANIK ml.
Pavel.Janik na inet.cz
Pátek Prosinec 5 00:23:46 CET 1997
Date: Thu, 4 Dec 1997 23:28:28 +0100 (MET)
From: "Jaroslav Volsicky student" <XVOLSICJ na feld.cvut.cz>
Pro zacatek by mi stacilo, kdybych dokazal vypisovat nazvy souboru v
danem adresari a v podadresarich!
Doufam, ze to naprosto jasne je :-))
----------------------------- cut here -----------------------------
#include <stddef.h>
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
int main (void) {
DIR *dp;
struct dirent *ep;
dp = opendir ("./");
if (dp != NULL) {
while (ep = readdir (dp))
puts (ep->d_name);
(void) closedir (dp);
}
else
puts ("Couldn't open the directory.");
return 0;
}
----------------------------- cut here -----------------------------
--
Pavel Janik ml.
Pavel.Janik na inet.cz
Další informace o konferenci Linux