Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!think.com!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.internals Subject: Re: Wizard-level questions Message-ID: <3763:Jan2623:23:3991@kramden.acf.nyu.edu> Date: 26 Jan 91 23:23:39 GMT References: <16048@sdcc6.ucsd.edu> Organization: IR Lines: 38 In article <16048@sdcc6.ucsd.edu> cs163wcr@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