Get path of a file descriptor in linux in node.js
/proc/self/fd/<fd>
is a symlink to it's file. You can use fs.readlink to get it's path:
> fs.openSync('.', 'r')
10
> fs.readlinkSync('/proc/self/fd/10')
'/home/alfred/repos/test
Written by Farid Nouri Neshat
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Nodejs
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#