[Techtalk] Open file descriptors
efindel at earthlink.net
Sun Jan 11 12:26:27 EST 2004
On Sunday 11 January 2004 06:46, David Sumbler wrote:
> Thanks, both, for your replies.
> As I now understand it, an "open file descriptor" simply means the
> stdout of a process. So far as I can see, it doesn't really
> *describe* anything, so no wonder I was confused by the term!
Well, let me throw my two cents in...
an open file descriptor is just a sort of "handle" to an open file. It's a
way for open program to open a file, then give another process that
What the program recieving the open file descriptor does with it is up to
the programmer who wrote it. Attaching it to the program's standard output
is one possibility -- but you could also choose to attach it to standard
input, or to simply use it as a regular open file.
Now, I've never heard of initlog before... but as a sometimes Unix
programmer, what the snippet you posted says to me is that one method is
designed to let initlog be used with whatever program you want (linking
stdin and stdout to initlog), while the other one is designed for using
initlog with programs that have been specifically written to work with
initlog. (Passing an open file descriptor, which that program is going to
have to "know" to do something with. What's more, initlog receives
commands on that open file descriptor... so the program in question would
have to know what sort of commands initlog takes.)
This is pretty close to a guess from general Unix programming knowledge,
since as I said, I've never heard of initlog before -- that's why I've
waited to post.
|\ _,,,---,,_ Travis S. Casey <efindel at earthlink.net>
ZZzz /,`.-'`' -. ;-;;,_ No one agrees with me. Not even me.
|,4- ) )-,_..;\ ( `'-'
More information about the Techtalk