fs.truncate(path[, len], callback)


异步的 truncate(2)。 除了可能的异常,完成回调没有其他参数。 文件描述符也可以作为第一个参数传入。 在这种情况下,调用 fs.ftruncate()

不推荐传入文件描述符,可能导致将来抛出错误。

Asynchronous truncate(2). No arguments other than a possible exception are given to the completion callback. A file descriptor can also be passed as the first argument. In this case, fs.ftruncate() is called.

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