Question: what is ftruncate in c?
Answer: DESCRIPTION. The ftruncate() function causes the regular file referenced by fildes to have a size of length bytes. The truncate() function causes the regular file named by path to have a size of length bytes. If the file previously was larger than length, the extra data is discarded.