repo.or.cz
/
glibc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Update.
[glibc.git]
/
manual
/
examples
/
dir.c
blob
b90f72da031b7184d46bb51d80c4467c611bf0f9
1
/*@group*/
2
#include <stddef.h>
3
#include <stdio.h>
4
#include <sys/types.h>
5
#include <dirent.h>
6
/*@end group*/
7
8
int
9
main
(
void
)
10
{
11
DIR
*
dp
;
12
struct
dirent
*
ep
;
13
14
dp
=
opendir
(
"./"
);
15
if
(
dp
!=
NULL
)
16
{
17
while
(
ep
=
readdir
(
dp
))
18
puts
(
ep
->
d_name
);
19
(
void
)
closedir
(
dp
);
20
}
21
else
22
puts
(
"Couldn't open the directory."
);
23
24
return
0
;
25
}