Created
February 5, 2019 01:23
-
-
Save tst-jlarocco/d2cb74a82713211a26908b0a10c7da74 to your computer and use it in GitHub Desktop.
Test lseek64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <iostream> | |
int main(int argc, char *argv[]) { | |
if (argc != 2) { | |
std::cout << "No input file given!\n"; | |
return 1; | |
} | |
int fd = open(argv[1], O_RDONLY); | |
uint64_t file_size = lseek64(fd, 0, SEEK_END); | |
close(fd); | |
std::cout << "File size: " << file_size << "\n"; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bigfile: bigfile.cpp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment