Blob
1 #include <u.h>2 #include <libc.h>4 void5 main(int argc, char **argv)6 {7 Dir d;9 if(argc != 3){10 fprint(2, "usage: trunc file size\n");11 exits("usage");12 }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 }