LoginSignup
0
0

More than 1 year has passed since last update.

[Node.js] fd から fs.WriteStream を作成する

Last updated at Posted at 2014-11-20

API DOCS には記載されていないが、fs.createWriteStream() の options に fd を渡すことができる。その際 path には null でも渡しておけばよい。

fs.createWriteStream(null, {fd: 1});

node/fs.js at 8d045a30e95602b443eb259a5021d33feb4df079 · joyent/node

// lib/fs.js
  this.fd = options.hasOwnProperty('fd') ? options.fd : null;

File System Node.js v0.10.33 Manual & Documentation

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0