Commit | Line | Data |
---|---|---|
1c2fdcc2 FT |
1 | #include <stdlib.h> |
2 | #include <stdio.h> | |
3 | #include <unistd.h> | |
4 | ||
5 | int main(int argc, char **argv) | |
6 | { | |
7 | if(argc < 3) { | |
8 | fprintf(stderr, "usage: trunc FILE SIZE\n"); | |
9 | exit(1); | |
10 | } | |
11 | if(truncate(argv[1], atoll(argv[2]))) { | |
12 | perror(argv[1]); | |
13 | exit(1); | |
14 | } | |
15 | return(0); | |
16 | } | |
17 | ||
18 | /* | |
19 | * Local Variables: | |
20 | * compile-command: "gcc -Wall -g -o trunc trunc.c -D_FILE_OFFSET_BITS=64" | |
21 | * End: | |
22 | */ |