HDTenEightyP/NetNews huggingface dataset:
From: kherron@ms.uky.edu (Kenneth Herron)
Subject: Re: A Lesson to be Learned (was Re: filesystem link ...)
    <1992Apr7.211911.9866@cfctech.cfc.com>
Distribution: na
Date: Wed, 8 Apr 1992 12:58:49 GMT
Organization: University Of Kentucky, Dept. of Math Sciences
X-Bytes: 

kevin@cfctech.cfc.com (Kevin Darcy) writes:

>Moral of the story: us Unix generalists shouldn't make hasty assumptions 
>about SPECIFIC implementations of modern Unix and Unix-like OSes. The 
>environments out there today are richer and more developer-friendly than they 
>were say 5 or 10 years ago. Live and learn...

Moral of the story:  If you want OS-specific answers, ask in OS-specific
groups.  Suppose you were asking about a feature that *nobody* had--
would you have preferred thundering silence because none of use were
*sure* nobody had implemented it?
-- 
Kenneth Herron                                       kherron@ms.uky.edu
University of Kentucky                                  +1 606 257 2975
Department of Mathematics
                                              Flame early, flame often.
Newsgroups: comp.unix.programmer
From: axel@cs.tu-berlin.de (Axel Mahler)
Subject: Re: Scripting in general
Organization: /home/stone/axel/.organization
Date: Wed, 15 Apr 1992 00:53:35 GMT

In article <1992Apr14.160036.18526@wrkgrp.COM> ets@wrkgrp.COM (Edward T Spire) writes:
   bengtl@maths.lth.se (Bengt Larsson) writes:
   : My wish would be for a new, C-like scripting language, with dynamic
   : typing, and string handling (and regexps) builtin. There was a man page
   : posted for such a language about a year ago. I can repost it, if there's
   : interest.
   : 
   : With such a language you could possibly implement quite a lot of things
   : as scripts, in a safe way. Perl is a little too much... Perl IMO.

You're looking for TCL. Check barkley.berkeley.edu (tcl).

Axel.
--
===============================================================================
Axel Mahler, Tech.Univ. Berlin
E-Mail: axel@cs.tu-berlin.de (axel@db0tui62.bitnet)
Voice: +49-30-314-73487
From: jik@athena.mit.edu (Jonathan I. Kamens)
Subject: Re: Interrupted system calls
Organization: Massachusetts Institute of Technology
Date: Mon, 6 Apr 1992 14:46:14 GMT

In article <1992Apr5.224334.24925@cc.uow.edu.au> zahra@cc.uow.edu.au (Andrew Zahra (Telecom)) writes:

   I am doing some work with internet domain sockets. Occaisonally I
   get an "interrupted system call" error (EINTR). What am I supposed
   to do about this?  Just try again?

In most cases, yes.

However, it's difficult to answer for sure without knowing more about
your program.... What's CAUSING the EINTR?  What signals are you
using?  What system calls are being interrupted?

There are problems with just restarting in some cases.  For example, I
believe it's possible for a write() to be interrupted after part of
the data you give it has already been written, and I don't think
there's any way to know how much data was written before the interrupt
(ugh!).

-- 
Jonathan Kamens						jik@MIT.Edu
MIT Information Systems/Athena		    Moderator, news.answers
    (Send correspondence related to the news.answers newsgroup
	{and ONLY correspondence related to the newsgroup}
		 to news-answers-request@MIT.Edu.)
From: smee@bristol.ac.uk (Paul Smee)
Newsgroups: comp.unix.programmer
Subject: Re: recursively moving to directories
Date: 14 Apr 92 10:06:20 GMT
Reply-To: P.Smee@bristol.ac.uk (Paul Smee)
Organization: University of Bristol

In article <1992Apr13.201312.15424@usenet.ins.cwru.edu> chet@odin.INS.CWRU.Edu (Chet Ramey) writes:
>In article <1992Apr13.023723.7892@cbr.dwr.csiro.au> marcus@cbr.dwr.csiro.au (Marcus Schnell) writes:
>
>>I want to change ownership of EVERYTHING in the current directory
>>recursively, files as well as subdirectories.

I've got a tacky 'ws' (that's walk_subtree, for all the multicians out
there) shell script that I use for things like that.  Looks like:

--------------------------------8<-----------------------------
: Bourne for speed

PATH=`echo $PATH | sed 's/^://g
			s/::/:/g
			s/:$//g
			s/\.://g
			s/:\.//g'`
cd $1
shift
eval "$@"
for name in `ls -al | awk '$1 !~ /^d/ {next}
			    $8 == "." {next}
			    $8 == ".." {next}
				{print $8}'`
do
    ws $name "$@"
done
-------------------------------8<-------------------------------

First bit is to take '.' out of your PATH, if it is there.  (Note
that it will be pathological if you have '..', or dirs starting or
ending with '.', in your PATH.  I don't.  Also note, doesn't chase
symlinks.

Usage is 'ws top_dir command and args'.  I often find 'ws dir csh'
to be handy.  Remember that if you use *'s and things you need to
quote them to keep them from expanding too early.

-- 
Paul Smee, Computing Service, University of Bristol, Bristol BS8 1UD, UK
 P.Smee@bristol.ac.uk - ..!uunet!uknet!bsmail!p.smee - Tel +44 272 303132
Newsgroups: comp.unix.programmer
From: amid@bullet.ecf (AMID  Rudy)
Subject: non-blocking accept()
Originator: amid@bullet.ecf.toronto.edu
Organization: University of Toronto, Engineering Computing Facility
Date: Thu, 9 Apr 1992 16:44:13 GMT

'lo,

  Can someone suggest to me exactly how to mark accept() non-blocking?  If
I RTFM correctly, I have to set the file descriptor somehow.  I'm a novice
Unix and C programmer so any help in this section is greatly appreciated.
This is, btw, a socket programming project that I have to do in University.

Thanks,
---
Rudy Amid  amid@ecf.toronto.edu                                            /\
   //      a378amid,a318amid,a209amid@cdf.toronto.edu                    (//\\)
  //
\X/     "This world needs its dreamers. May they never wake up." -Prefab Sprout
Xref: sparky comp.unix.programmer:2262 comp.unix.admin:2717
From: wally+@andrew.cmu.edu (Wallace Colyer)
Newsgroups: comp.unix.programmer,comp.unix.admin
Subject: Re: logging outgoing telnet sessions to catch 'hackers'
Date: 7 Apr 92 13:09:26 GMT
	<2769@copper.Denver.Colorado.EDU>
Organization: Software Development, Carnegie Mellon, Pittsburgh, PA

Excerpts from netnews.comp.unix.admin: 6-Apr-92 logging outgoing telnet
ses.. Swift@copper.denver.colo (919)

> Some options I've considered:
> 0. Modifying the kernel. Not possible without the source.

We have modified our ultrix kernels on some key time sharing machines to
log outgoing smtp connections with a simple kernel printf (we used the
same procedure to block outgoing connections to X11 ports on these
machines to reduce load).  If you have sources this is real easy to do.

-Wallace
Newsgroups: comp.unix.programmer
From: randy@rss.dl.nec.com (Randy Bullard)
Subject: Re: Examples for Shared Memory and Semaphores 
Organization: NEC America
Date: Mon, 6 Apr 1992 13:37:24 GMT

In article <1992Apr3.211047.18232@trantor.harris-atd.com>, mishra@controls.NoSubdomain.NoDomain (Sanjoy Mishra) writes:
|> Hi,
|>  I am looking for examples on using shared memories and semaphores
|>   Thanks in advance for any help.
|> 
|> -sanjay
|> mishra@ccd.harris.com
|> 

Your best bet is one of several good books.  I recommend Richard
Steven's "Unix Network Programming".  Another good one for shared
memory and semaphores (but limmitted in sockets/streams/other stuff)
is Marc Rochkind's "Advanced Unix Programming"

P.S. I tried to reply direct via mail, but it bounced...

-- 
- Randy Bullard  -    Dallas, TX randy@rss.dl.nec.com
					  Home (214)750-4934
					  Work (214)907-4463

| Have you ever rubbed your thigh with number 10 sandpaper and     |
| poured Red Devil turpentine on it?  I hate it when that happens. |
Newsgroups: comp.unix.programmer
From: schwartz@roke.cs.psu.edu (Scott Schwartz)
Subject: Re: recursively moving to directories
Organization: penn state university, computer science
	<1992Apr13.023723.7892@cbr.dwr.csiro.au>
	<1992Apr13.201312.15424@usenet.ins.cwru.edu>
Date: Mon, 13 Apr 1992 23:01:27 GMT


chet@odin.INS.CWRU.Edu (Chet Ramey) writes:
   Without chown -R, use find piped to xargs.
   find . -print | xargs /etc/chown foo

Hopefully you have no filenames with whitespace in them.  If you have
gnu find/xargs, it is safer:

   find . -print0 | xargs -0 /etc/chown foo

(Gratuitous whine: This is a general problem with pipe fitting:
programs often don't agree on field and record separators.  If
everything would just print in "external form", like most lisp systems
do, it would be much easier.)
From: buzz@toxicavenger.fsrg.bear.com (Buzz Moschetti)
Newsgroups: comp.unix.programmer
Subject: Re: Need help writing Front End
Date: 9 Apr 92 13:13:54 GMT
Organization: Bear, Stearns & Co. Inc.
In-reply-to: dlutz@willamette.edu's message of 5 Apr 92 23:24:43 GMT

In article <1992Apr5.232443.12931@willamette.edu> dlutz@willamette.edu (David Lutz) writes:

   Hello--
     I am trying to write a front end for a program and I need some help.

      The idea is something like this.

	FILE *pipe = popen( "program", "rw" );


	while ( test )
	{
	   read from pipe only if data is waiting to be read.
	   process data.
	   read from stdin only if data ready
	   process keystokes and send out on the pipe
	}

   I assume this needs some kind of non-blocking io calls for the streams,
   but I am not sure how to go about doing this.

   Any help would be appreciated.   Thanks

   D.L.

1.  popen() creates a stream for either read or write, not both.  Sorry :-)
    Use the standard pipe()/fork()/exec() trick to create an IPC channel to
    program.    

2.  Do you have OpenWindows/xview?  If so, then you might want to use the raw
    (raw?) Notifier to manage your file descriptors.  You still have to do
    the pipe()/fork()/exec() work but data ready on the descriptors becomes
    an event poster via:
	      notify_set_input_func();
    The O'Reilly manual (and answerbook) contains an example called 
    notify_pipe.c or similar that is quite similar to what you are trying to
    accomplish.

--
"Usually this is a couple of lines." -Well paid consultant.
Newsgroups: comp.unix.programmer
From: jik@athena.mit.edu (Jonathan I. Kamens)
Subject: Re: non-blocking accept()
Organization: Massachusetts Institute of Technology
Date: Thu, 9 Apr 1992 20:03:40 GMT

In article <1992Apr9.164653.17745@helios.physics.utoronto.ca> amid@bullet.ecf (AMID  Rudy) writes:

   From: amid@bullet.ecf (AMID  Rudy)

Please fix your news software to put a valid reply address in the
headers of your outgoing postings, or get your admin to do it, or at
the very least insert a Reply-To line into your postings with a valid
address in it.

   (repost to comp.unix.wizards. My site's Pnews won't do the crossposting for me)

First of all, your question should not have been posted at all in
comp.unix.wizards.  Have you read the "Intro to comp.unix.wizards -
read before posting" article that is posted weekly in that newsgroup?

Second, I think that it's much more likely that you're doing the
cross-posting wrong than that Pnews won't do it.  What did you put in
the Newsgroups line when you were trying to cross-post?  What
happened?

Third, even if it's true that Pnews won't do it, it's inappropriate to
burden the entire USENET with your site's problems.  If your site's
software is only capable of posting to one newsgroup at a time, then
you should either (a) get your software fixed or (b) only post your
articles to one newsgroup.  Forcing the entire USENET to carry
multiple copies of your articles because your site is broken is
unreasonable.

     Can someone suggest to me exactly how to mark accept() non-blocking?  If
   I RTFM correctly, I have to set the file descriptor somehow.  I'm a novice
   Unix and C programmer so any help in this section is greatly appreciated.

Your mark a socket as non-blocking using the fcntl(2) system call.
Something like this:

#include <fcntl.h>

...

int s, res, flags;

... code that initializes s ...

flags = fcntl(s, F_GETFL, 0);
if (flags == -1) {
	perror("fcntl");
	exit(1);
}
flags |= FNDELAY;
res = fcntl(s, F_SETFL, flags);
if (res == -1) {
	perror("fcntl");
	exit(1);
}

   This is, btw, a socket programming project that I have to do in University.

So, you're asking us to do your homework for you?  Or am I just
misunderstanding?  If this is for a school project, aren't there
people there who are available to help you with it?

-- 
Jonathan Kamens						jik@MIT.Edu
MIT Information Systems/Athena		    Moderator, news.answers
    (Send correspondence related to the news.answers newsgroup
	{and ONLY correspondence related to the newsgroup}
		 to news-answers-request@MIT.Edu.)

Newsgroups: comp.unix.programmer
From: net@cs.tu-berlin.de (Oliver Laumann)
Subject: Re: Lost: an interesting hack
Organization: Technical University of Berlin, Germany
Date: Wed, 8 Apr 1992 15:19:32 GMT

In article <1992Apr01.215845.7815@spike.insci.com>
ross@insci.com (Ross Andrus) writes:
>   It goes (roughly) like this:  we want to save an `image' of a running 
>   process so that we can start it up again more or less exactly where it
>   left off. The general idea of the hack was to discover the extent of the 
>   data segment, write the whole mess to a file, and then later, in another 
>   process, read it all back in and pick up execution where it left off. 

The `Elk' software package (an implementation of the Scheme programming
language) comes with code that does what you described.  Elk has a
built-in function named `dump' that creates an a.out from the running
process and returns #f (the boolean constant `false' in Scheme).  When
you start the new a.out it resumes execution in the middle of the call
to `dump' that created the a.out; this time `dump' returns #t (true).

Of course, things like file descriptors and signal handlers do not
survive a `dump'.

The code in Elk that saves the process image into a file can deal with
several different a.out formats, among them BSD a.out, COFF, and ELF.

However, the code that causes the new a.out to start execution at the
point where the image was saved is based on Scheme `continuations'.
It's probably difficult to extract this code from Elk in order to
use it in a different application.

GNU-Emacs has a function named `unexec' that is similar to `dump',
except that the a.out created by unexec always starts at the base
program's entry point (or some other, but fixed, entry point).  Several
Lisp implementations have functions to create an executable file from
the image of the running interpreter.  TeX comes with a utility
(`undump') to create an a.out from a core file.

The Elk distribution is available for anonymous FTP from export.lcs.mit.edu
(contrib/elk-1.5a.tar.Z).

--
Oliver Laumann    net@tub.cs.tu-berlin.de  net@tub.UUCP  net@tub.BITNET
Newsgroups: comp.unix.programmer
From: msb@sq.sq.com (Mark Brader)
Subject: Re: How to write the ANSI C time functions
Organization: SoftQuad Inc., Toronto, Canada
Date: Wed, 15 Apr 92 05:34:08 GMT

> > So the C standard clearly *is*
> > calling for leap seconds to be respected.
> 
> *I* just see it as *allowing* leap seconds to be respected, but since it
> doesn't explicitly say "leap seconds are respected", I don't see it as
> "calling for" them to be respected in the sense of "requiring them to be
> respected".

It doesn't explicitly say "leap years are respected" either!  It doesn't
have to.  Leap seconds, like leap years, are now built into our calendar;
the standard would have to explicitly say if they *weren't* respected.

This may seem counterintuitive for leap seconds, but that's only because
we're all used to clocks and watches that can't keep good enough time for
the difference to matter.

If POSIX requires leap seconds to be ignored, it really does conflict with
the C standard.
-- 
Mark Brader			To err is human, but to really mess things up
SoftQuad Inc., Toronto		you need a timetable planner!
utzoo!sq!msb, msb@sq.com				-- Richard Porter

This article is in the public domain.
From: bengtl@maths.lth.se (Bengt Larsson)
Newsgroups: comp.unix.programmer
Subject: Re: Scripting in general
Date: 17 Apr 92 11:50:23 GMT
Organization: Lund Institute of Technology, Sweden

In article <1992Apr15.004145.3945@murdoch.acc.Virginia.EDU> spm2d@uvacs.cs.Virginia.EDU (Steven P. Miale) writes:
>In article <AXEL.92Apr15015335@avalanche.cs.tu-berlin.de>, axel@cs.tu-berlin.de (Axel Mahler) writes:
>> In article <1992Apr14.160036.18526@wrkgrp.COM> ets@wrkgrp.COM (Edward T Spire) writes:
>>    bengtl@maths.lth.se (Bengt Larsson) writes:
>>    : My wish would be for a new, C-like scripting language, with dynamic
>>    : typing, and string handling (and regexps) builtin. There was a man page
>>    : posted for such a language about a year ago. I can repost it, if there's
>>    : interest.
>
>Try Python - it has regular expressions built in, POSIX support
>(including fork), sockets, etc. String handling is built in,
>as well as dynamic-length lists. VERY easy to learn - an hour or
>two, max.

I've tried TCL and it's nice, but not quite it. For one thing, the
only data type is the string (though that's deliberate. Intended for
embedding).

I don't know about Python, but I'll check it out.

Bengt Larsson.
-- 
Bengt Larsson - bengtl@maths.lth.se
Xref: sparky comp.unix.programmer:2437 comp.unix.questions:6278 comp.unix.misc:2096
From: jfw@ksr.com (John F. Woods)
Newsgroups: comp.unix.programmer,comp.unix.questions,comp.unix.misc
Subject: Re: Input within a time frame
Date: 17 Apr 92 15:46:09 GMT
Distribution: na

nowlola@elof.iit.edu (Olatunji Nowlin) writes:
>Does anyone know how I would be able to get a character
>of input within a certain time limit (say 3 seconds?).
>The getchar() , getc() etc., routines don't use time
>limits (you can take as loooong as you want, which
>is not desirable in the program).  Is there some
>routine that would get the input within a certain
>time frame?

Standard C does not have any capability to do this, so I am removing comp.std.c
from the newsgroup list.

>PPS This is on a Unix system btw.

You are in luck.

As a crude means, the following will just about do it:

	sig_atomic_t ouch;
	handleit() {
		ouch=1;
	}

	signal(SIGALRM, handleit);

	alarm(3);
	if ((c = getchar()) == EOF) {
		if (ouch)
			/* didn't read a character in time */
		...
	}
	alarm(0);

One defect in this approach are the possibility that you won't get
scheduled for 2 seconds and will thus miss a character that did arrive
in time, or worse, you won't get scheduled for 4 seconds and thus the
interrupt won't happen during the read at all (having already happened).

If you're on a System V or POSIX system, you can use the VMIN/VTIME feature
of TERMIO(S) to do a timed read without so many hassles.  That's harder to
construct a quicky example for, so I'll leave it to your local manuals...
From: nagle@netcom.com (John Nagle)
Newsgroups: comp.unix.programmer
Subject: Re: logging outgoing telnet sessions to catch 'hackers'
Date: 9 Apr 92 16:50:29 GMT
Article-I.D.: netcom.3!sj8tj.nagle
Organization: Netcom - Online Communication Services  (408 241-9760 guest)

wietse@wzv.win.tue.nl (Wietse Venema) writes:

>l1ngo@copper.denver.colorado.edu (Swift) writes:

>>We're running Dynix on a Sequent S81 and are considering methods of
>>logging outgoing telnet sessions. 

       This raises privacy issues.  You are violating the security of
your users.  Suggest you check with your lawyers before doing this to
see if it is an ECPA violation.  

					John Nagle
From: bengtl@maths.lth.se (Bengt Larsson)
Newsgroups: comp.unix.programmer
Subject: Scripting in general
Date: 11 Apr 92 20:11:23 GMT
Organization: Lund Institute of Technology, Sweden

In article <id.06QO.O83@ferranti.com> peter@ferranti.com (Peter da Silva) writes:
>In article <1992Apr6.082205.3979@lth.se> bengtl@maths.lth.se (Bengt Larsson) writes:
>Well, that's the point. I run this sort of interactive loop all the time.
>Just toss 'em off, either in csh (foreach) or in sh (for).

8-line loops with if-then-elses? Well, I'm impressed. But you have to be
a serious wizard to do this habitually.

>>[rename *.foo *.bar]
>
>No, it was my example because it was the case brought up by this discussion.

Nevertheless this example keeps cropping up. And so it did here.

>> >	rename %1.%2.c %1/%2/%2.c

This, however doesn't keep cropping up. It's a theoretical exercise.

>I haven't written "rename" either. I write loops.

The point of quite a many postings is that having a "rename" command
would be nice. Writing loops interactively is... hackery. IMO.

>I *did* snarf a general "rename" program from somewhere a few years back,
>but I found I was using it so infrequently I didn't bother adding it to
>my "must have" toolbox. As I recall, it did have a more general syntax along
>the lines of the one I suggested above.

Which was my point.

>Neither. I never *claimed* it was a working program. I said the solution
>"would be along the lines of" the code I wrote. If I'd packaged it up as
>a shell archive and posted it to alt.sources you'd have a valid complaint.
>Discussion groups are for discussion, not code distribution.

All right, you can't demand industrial-strength software in examples. 
Your rename example, however, did only contain _one_ line that wasn't
bogus! This is going too far.

As for programming language suitability:

   ** It isn't possible to write a "rename" script in "sh" that handles
   ** all valid filenames.

Over to something else, I looked in /bin, /usr/bin, /usr/5bin etc on
my Sun (SunOS 4.1.2) and found a couple of commands delivered as
scripts. These scripts come from both UCB and SVR[23].

Most of the scripts which use filenames can't handle special characters
in the names. So you can't do "cflow", or "diff3", for example
on filenames containing special chars, like spaces.

Does anyone but me think this is completely bogus? Distributed programs
that blow up on perfectly legal filenames?

Re-write them in rc!

Bengt Larsson.
-- 
Bengt Larsson - bengtl@maths.lth.se
Newsgroups: comp.unix.programmer
From: phil@ux1.cso.uiuc.edu (Phil Howard)
Subject: Re: : non-blocking accept()
Organization: University of Illinois at Urbana
Date: Mon, 13 Apr 1992 19:36:51 GMT

subbarao@phoenix.Princeton.EDU (Kartik Subbarao) writes:

>In article <FRANL.92Apr10121115@draco.centerline.com> franl@centerline.com (Fran Litterio) writes:
>
>>Is it worth pointing out that select() is not part of Posix.1, so by
>>using it you run the risk that your code will not port to some pure
>>System V/Posix.1 machines?  Just how many systems don't provide
>>select() anyway?
>
>What? select() is a really useful system call. Other ways of concurrently 
>checking for I/O on multiple file descriptors are not appropriate all the
>time. Is there something remotely resembling select() ?
>
>	-Kartik

So I take it that System V/Posix.1 machines that have no vendor supplied
added features simply CANNOT do asyncronous I/O in any consistent way across
all socket types.
Newsgroups: comp.unix.programmer
From: hashmi@cse.uta.edu (Atiqullah Hashmi)
Subject: Sending a signal to another process; books don't recommend
Organization: Computer Science & Engineering, Univ. of Texas at Arlington
Distribution: na
Date: Thu, 16 Apr 1992 21:06:08 GMT


Hi,

I have some processes and I want to send signals and msgs from them
(only in particular situations) to a process which is a controller
process and has to do a lot of stuff, so that I can't let it wait on a
pipe or socket (I don't want to use non-blocking approach either). I
want that the controller should invoke relevant functions only when it
receives signals from other processes , and other than that should do
its buisness.  And since the signals can't send any data, I plan to use
a shared memory to pass data from other processess to the controller
which will read it when signalled by other processes.
This seems to be a simple approach but the problem is that books don't
recommend it.

Are non-blocking sockets or pipes the only approach for such situations ?.

Any help is appreciated.

hashmi
-- 
-----
Atiqullah Hashmi                     
UTA (Univ. of Texas at Arlington)   
hashmi@cse.uta.edu                 
Newsgroups: comp.unix.programmer