Michael Daffin Michael Daffin 3, 1 1 gold badge 9 9 silver badges 20 20 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog.
Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile.
Linked 2. Related 0. Hot Network Questions. Processes interact with files via file descriptors. When a process opens a file, the OS gives the process a file descriptor a number which the process can use to read or write from the open file.
We can see this with strace :. Here, cat foo. The standard streams in, out and error are at file descriptors 0, 1 and 2 respectively. The standard streams are pre-attached; the process does not have to open them. For example, cat run with no arguments reads from file descriptor 0 and writes to file descriptor 1. In a shell pipeline, these standard file descriptors are references to anonymous pipes. Which numbers do you think it gets back? Personally I would create two functions. Add a comment.
Active Oldest Votes. Improve this answer. Nahuel Fouilleul Nahuel Fouilleul Sorry my mistake, I have a bad habit of referring to them both as the same thing I'll edit. Inian Inian Actually stdin could well be a pipe, not a terminal, right? Inian thanks for the answer. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.
The Overflow Blog. Does ES6 make JavaScript frameworks obsolete?
0コメント