/* * As its sole author, I explicitly place this program in the public domain. * It may be used by anyone in any way for any purpose, though I would * appreciate credit where it's due. * der Mouse, mouse@rodents.montreal.qc.ca, 1998-08-05 */ #include #include #include #include #include extern const char *__progname; static off_t length; int main(int, char **); int main(int ac, char **av) { if (ac != 3) { fprintf(stderr,"Usage: %s pathname length\n",__progname); exit(2); } length = strtoq(av[2],0,0); if (truncate(av[1],length) < 0) { fprintf(stderr,"%s: truncate %s to %lld: %s\n",__progname,av[1],(long long int)length,strerror(errno)); exit(1); } exit(0); }