diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 76165638839e38..59c41b77d4fd16 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -719,6 +719,17 @@ The internal `path._makeLong()` was not intended for public use. However, userland modules have found it useful. The internal API has been deprecated and replaced with an identical, public `path.toNamespacedPath()` method. + +### DEP0081: fs.truncate() + +Type: Runtime + +`fs.truncate()` `fs.truncateSync()` usage with +a file descriptor has been deprecated. + +*Note*: Please use `fs.ftruncate()` or `fs.ftruncateSync()` +to work with file descriptors. + [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size [`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array diff --git a/doc/api/fs.md b/doc/api/fs.md index 0c91ec7b352722..5e74d16daf7a6d 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2268,6 +2268,9 @@ 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. +*Note*: Passing a file descriptor is deprecated and may result in an error +being thrown in the future. + ## fs.truncateSync(path[, len])