ftest.c 502 B

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