xref: /plan9/sys/src/cmd/fossil/trunc.c (revision 0b459c2cb92b7c9d88818e9a2f72e678e5bc4553)
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