根据linux man page O_TRUNC在可写情况下才会截断。
If the file already exists and is a regular file and the access mode allows writing (i.e., is O_RDWR or O_WRONLY) it will be truncated to length 0. If the file is a FIFO or terminal device
file, the O_TRUNC flag is ignored. Otherwise, the effect of O_TRUNC is unspecified.