aboutsummaryrefslogtreecommitdiff
path: root/src/lib9p/ftest.c
blob: d65e2de0b27a968eb42092ae5780e643f4b3f71a (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
#include <u.h>
#include <libc.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);
}