#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
if (argc < 2)
{
fprintf(stderr, "usage:\n%s filepath", argv[1]);
exit(1);
}
int fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC);
if (fd < 0)
{
perror("open() ");
exit(1);
}
lseek(fd, 5LL * 1024LL * 1024LL * 1024LL, SEEK_SET);
write(fd, "", 1);
close(fd);
exit(0);
}
伪造大文件
最新推荐文章于 2024-09-30 08:05:35 发布