summaryrefslogtreecommitdiffstats
path: root/src/cmd/upas/fs/readdir.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-10-29 16:26:44 +0000
committerrsc <devnull@localhost>2005-10-29 16:26:44 +0000
commit5cdb17983ae6e6367ad7a940cb219eab247a9304 (patch)
tree8ca1ef49af2a96e7daebe624d91fdf679814a057 /src/cmd/upas/fs/readdir.c
parentcd3745196389579fb78b9b01ef1daefb5a57aa71 (diff)
downloadplan9port-5cdb17983ae6e6367ad7a940cb219eab247a9304.tar.gz
plan9port-5cdb17983ae6e6367ad7a940cb219eab247a9304.zip
Thanks to John Cummings.
Diffstat (limited to 'src/cmd/upas/fs/readdir.c')
-rw-r--r--src/cmd/upas/fs/readdir.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cmd/upas/fs/readdir.c b/src/cmd/upas/fs/readdir.c
new file mode 100644
index 00000000..42028d4c
--- /dev/null
+++ b/src/cmd/upas/fs/readdir.c
@@ -0,0 +1,15 @@
+#include <u.h>
+#include <libc.h>
+
+void
+main(void)
+{
+ Dir d;
+ int fd, n;
+
+ fd = open("/mail/fs", OREAD);
+ while((n = dirread(fd, &d, sizeof(d))) > 0){
+ print("%s\n", d.name);
+ }
+ print("n = %d\n", n);
+}