9

How does tar read files to create an archive?

view full story
linux-howto

http://stackoverflow.com – What system call does tar use to get the content of files that it uses to create an archive? I tried using strace to see the call, but it never calls open on the file. $ echo "HelloWorld" > my_test_file $ strace -s250 -f -F tar -cf /dev/null my_test_file 2>&1 | grep my_test_file execve("/bin/tar", ["tar", "-cf", "/dev/null", "my_test_file"], [/* 20 vars */]) = 0 newfstatat(AT_FDCWD, "my_test_file", {st_mode=S_IFREG|0664, st_size=11, ...}, AT_SYMLINK_NOFOLLOW) = 0 newfstatat(AT_FDCWD, "my_test_file", {st_mode=S_IFREG|0664, st_size=11, ...}, AT_SYMLINK_NOFOLLOW) = 0 I am guessing (HowTos)