xref: /plan9/sys/src/cmd/fossil/trunc.c (revision a84536681645e23c630ce4ef2e5c3b284d4c590b)
1 #include <u.h>
2 #include <libc.h>
3 
4 void
5 main(int argc, char **argv)
6 {
7 	Dir d;
8 
9 	if(argc != 3){
10 		fprint(2, "usage: trunc file size\n");
11 		exits("usage");
12 	}
13 
14 	nulldir(&d);
15 	d.length = strtoull(argv[2], 0, 0);
16 	if(dirwstat(argv[1], &d) < 0)
17 		sysfatal("dirwstat: %r");
18 	exits(0);
19 }
20