aboutsummaryrefslogtreecommitdiff
path: root/src/lib9p/ftest.c
blob: 6692b7f16446f3024241e6f6d5605cb79219caed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <u.h>
#include <libc.h>
#include <auth.h>
#include <fcall.h>
#include "9p.h"

void
main(void)
{
	Tree *t;
	File *hello, *goodbye, *world;

	t = mktree();

	hello = fcreate(t->root, "hello", CHDIR|0777);
	assert(hello != nil);

	goodbye = fcreate(t->root, "goodbye", CHDIR|0777);
	assert(goodbye != nil);

	world = fcreate(hello, "world", 0666);
	assert(world != nil);
	world = fcreate(goodbye, "world", 0666);
	assert(world != nil);
	fdump(t->root, 0);

	fremove(world);
	fdump(t->root, 0);
}