Ticket #19215: fu.c
File fu.c, 457 bytes (added by , 38 hours ago) |
---|
Line | |
---|---|
1 | #include <sys/stat.h> |
2 | #include <fcntl.h> |
3 | #include <utime.h> |
4 | #include <stdio.h> |
5 | #include <unistd.h> |
6 | |
7 | int main () |
8 | { |
9 | for (int i = 0; i < 10; i++) { |
10 | char buf[100]; |
11 | sprintf (buf, "dummy%d", i); |
12 | |
13 | int fd = open (buf, O_CREAT|O_RDWR, 0644); |
14 | if (fd < 0) |
15 | perror ("open"); |
16 | |
17 | close (fd); |
18 | |
19 | struct utimbuf tb = { .actime = 1730303310, .modtime = 1730303310 }; |
20 | int ret = utime (buf, &tb); |
21 | if (ret < 0) |
22 | perror ("utimes"); |
23 | } |
24 | } |