* Truncates a file asynchronously. * @param {string} filePath The file path * @param {number|Function} [len] The new length or callback * @param {Function} [callback] Callback (err)
(filePath, len, callback)
| 902 | * @param {Function} [callback] Callback (err) |
| 903 | */ |
| 904 | truncate(filePath, len, callback) { |
| 905 | if (typeof len === 'function') { |
| 906 | callback = len; |
| 907 | len = 0; |
| 908 | } |
| 909 | try { |
| 910 | this.truncateSync(filePath, len); |
| 911 | process.nextTick(callback, null); |
| 912 | } catch (err) { |
| 913 | process.nextTick(callback, err); |
| 914 | } |
| 915 | } |
| 916 | |
| 917 | /** |
| 918 | * Truncates a file descriptor asynchronously. |
nothing calls this directly
no test coverage detected