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.