diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 76165638839e38..2a21d645b6e46c 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -719,6 +719,15 @@ 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() using a file descriptor + +Type: Runtime + +`fs.truncate()` `fs.truncateSync()` usage with a file descriptor has been +deprecated. 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 997a99a612402d..1d131ef5413e37 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2266,6 +2266,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])