系统函数-文件操作-truncate()

来源:互联网 发布:世界征服者3 mac 编辑:程序博客网 时间:2024/05/23 18:56
文件截断或填充
truncate#include <unistd.h>int truncate(const char * path, off_t length);int ftruncate(int fd, off_t length);函数说明:truncate()会将参数path 指定的文件大小改为参数length 指定的大小. 如果原来的文件大小比参数length 大, 则超过的部分会被删去.返回值:执行成功则返回0, 失败返回-1, 错误原因存于errno.
0 0
原创粉丝点击