Wizard-level questions
Dan Bernstein
brnstnd at kramden.acf.nyu.edu
Sun Jan 27 10:23:39 AEST 1991
In article <16048 at sdcc6.ucsd.edu> cs163wcr at sdcc10.ucsd.edu (I support the U.N.) writes:
> I have been hacking at these questions for a while, using various
> reference books, with no real progress.
That doesn't make them wizard-level questions.
> [1] Can you access a file by its i-node number? Something like
> (for C code) FILE *iopen (int inode, char *mode) ?
With any reasonable efficiency? Not portably.
> [2] With Internet sockets, how does a machine accept()ing a
> socket connection know what machine is calling it?
accept() has three parameters, the second of which is filled in with the
address of the calling machine.
> [3] I have a server program that reads my mail and does various
> functions. One thing I would like it to do is send a "write"
> message to other users when it gets a letter with subject
> "WRITE user", sending the letter body as the message, but I
> can't get write to work unless the output is a tty. How do
> I fool write into thinking my pipe is a tty?
You probably mean that the input is a pipe. In any case, use ``pty
write'' in place of ``write''. pty was published in comp.sources.unix
volume 23; the latest version is available via anonymous ftp to
128.122.128.22.
> [4] How did you become a Unix Wizard?
Who are you talking to?
If you define ``wizard'' as someone who can write any program on the
system, the answer should be obvious. Other definitions lead to other
answers.
---Dan
More information about the Comp.unix.internals
mailing list