home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
c
/
jazlib.arc
/
TRUNCFIL.DMO
< prev
next >
Wrap
Text File
|
1986-07-02
|
492b
|
22 lines
main(argc,argv)
int argc;
char **argv;
{
long atol();
if (argc < 4) {
printf("\nUsage: TRUNCATE <Filename> <Original Size> <New Size>");
exit(1);
}
if (filesize(argv[1]) == 0L || atol(argv[2]) != filesize(argv[1])) {
printf("\nUnable to truncate %s",argv[1]);
exit(1);
}
if (truncate(argv[1],atol(argv[3])))
printf("\nError truncating %s",argv[1]);
else
printf("FILE: %s, changed from %s to %s bytes",argv[1],argv[2],argv[3]);
}