ftest.c (484B)
1 #include <u.h> 2 #include <libc.h> 3 #include <fcall.h> 4 #include "9p.h" 5 6 void 7 main(void) 8 { 9 Tree *t; 10 File *hello, *goodbye, *world; 11 12 t = mktree(); 13 14 hello = fcreate(t->root, "hello", CHDIR|0777); 15 assert(hello != nil); 16 17 goodbye = fcreate(t->root, "goodbye", CHDIR|0777); 18 assert(goodbye != nil); 19 20 world = fcreate(hello, "world", 0666); 21 assert(world != nil); 22 world = fcreate(goodbye, "world", 0666); 23 assert(world != nil); 24 fdump(t->root, 0); 25 26 fremove(world); 27 fdump(t->root, 0); 28 }