fs.truncateSync(path[, len])


截断文件。返回 undefined。也可以传递文件描述符作为第一个参数。在这种情况下,将调用 fs.ftruncateSync()

【Truncates the file. Returns undefined. A file descriptor can also be passed as the first argument. In this case, fs.ftruncateSync() is called.】

传递文件描述符已被弃用,将来可能会导致抛出错误。

【Passing a file descriptor is deprecated and may result in an error being thrown in the future.】