[comp.os.eunice] vms format files and unix format files

edwards@uwmacc.UUCP (mark edwards) (03/18/87)

 I have been playing around with rrn on Eunice these days and have
 notice some interesting (read: very frustrating and maddening )
 features of Eunice.

 It seems to make a difference in what format a file is. There are
 two formats, at least, unix and VMS. Now I had gotten rrn working
 as for as being able to read news and postnews remotely, but I 
 could not save the articles that I wanted to. It said it saved it
 and then I looked in the directory. Nothing there. Well I realize
 that Eunice has problems returning error coders of forked processes
 and such. But lying about what it is doing is another story.

 The problem was that the "mbox.saver" shell script was in Unix format.
 I changed it to VMS format and viola it worked. Before doing this 
 I noticed that the script when called from csh would fault with 
 the typical VMS error code "Error in Activation" or something like
 that. But when I ran it through sh on the command line it worked.
 After changing it to VMS format it worked on the command line without
 the sh.

 Does anybody have an explanation for this ????

 Yes I use Eunice. Do You ?
 mark

-- 
    edwards@unix.macc.wisc.edu
    {allegra, ihnp4, seismo}!uwvax!uwmacc!edwards
    UW-Madison, 1210 West Dayton St., Madison WI 5370ug

jbuck@epimass.UUCP (Joe Buck) (03/19/87)

In article <1250@uwmacc.UUCP> edwards@uwmacc.UUCP (mark edwards) writes:
>
> I have been playing around with rrn on Eunice these days and have
> notice some interesting (read: very frustrating and maddening )
> features of Eunice.

You aren't alone.  I did the Eunice code for 2.11 news.  What a bitch!

Shell scripts must be in "VMS format" (specifically, variable length,
carriage return format) to be executable.  Otherwise Eunice thinks
you're trying to execute a VMS image, and you get strange error
messages indicating that you're executing an invalid image (something
about $IMGACT failing).  You can say "sh file" or "csh file"
regardless of format, though.  But Wollongong could have had the
exec call check for the "#!" magic cookie regardless of format,
thus avoiding this problem.  But NOOOOO!

Also, doing random seeks and modifications to a file only works if
it's in Unix format.  Never let your active file get in VMS format,
or all bets are off.  Your news system will be trashed.
-- 
- Joe Buck 	{hplabs,ihnp4,sun,ames}!oliveb!epimass!jbuck
		seismo!epiwrl!epimass!jbuck  {pesnta,tymix,apple}!epimass!jbuck
  Entropic Processing, Inc., Cupertino, California

leres@ucbvax.UUCP (03/24/87)

There's a reason why exec() works the way it does under Eunice; it's
faster for the 99% case. If the file is fixed length, exec() simply
tries to execute it as a VMS image. If it's a variable length file, it
reads a record to extract the name of the shell to use. Those who know
how slow file I/O is under VMS will see why you want to avoid the read.
It may not seem like much overhead, but Unix programs use exec()
extensively and it quickly adds up.

I disagree with the statement that random seeks only work with Unix
files; although not efficient, random seeks work fine. They are slow
when dealing with a variable length file is because you must seek to
the beginning of the file and read until you get to the right place.
So make sure /etc/termcap is a fixed length file!

		Craig

jbuck@epimass.UUCP (03/25/87)

In article <17989@ucbvax.BERKELEY.EDU> leres@ucbarpa.Berkeley.EDU (Craig Leres) writes:

>There's a reason why exec() works the way it does under Eunice; it's
>faster for the 99% case. If the file is fixed length, exec() simply
>tries to execute it as a VMS image. If it's a variable length file, it
>reads a record to extract the name of the shell to use.

Ah, but it would add no overhead at all to see if it's a shell script
after trying to execute it as a VMS image fails.

If the Eunice developers were so concerned about speed they should
have made sure that scripts beginning with

#! /bin/csh -f

work correctly (the -f flag is ignored, meaning the user's .cshrc
file is always read).

>I disagree with the statement that random seeks only work with Unix
>files; although not efficient, random seeks work fine. 

You misquoted (or rather, misparaphrased) me.  I said you can't
UPDATE a "VMS format" file using random seeks (as in read-modify-write).
If you try, you'll get garbage.

>They are slow
>when dealing with a variable length file is because you must seek to
>the beginning of the file and read until you get to the right place.
>So make sure /etc/termcap is a fixed length file!

Doesn't help.  /etc/termcap is read from the beginning.



-- 
- Joe Buck 	{hplabs,ihnp4,sun,ames}!oliveb!epimass!jbuck
		seismo!epiwrl!epimass!jbuck  {pesnta,tymix,apple}!epimass!jbuck
  Entropic Processing, Inc., Cupertino, California

kashtan@sri-unix.UUCP (03/25/87)

As the person who did the original Eunice, you can blame me for this
problem.  It is certainly the case that, as of the 4.3bsd-based version
of Eunice, the "#! /bin/csh -f" construct does indeed work and that csh
WILL ignore any startup files.  Craig's explanation for the apparent
problem with shell scripts still in UNIX format is correct.  The problem
is that by the time you are actually activating the image control is in
the CLI of the process that runs the program.  This is an impoverished
enough execution environment that it is extremely difficult to change
the program invocation to shell invocation with the appropriate arguments.
So, in order to keep from having to read the executable file several times
the assumption is made that shell scripts will ALWAYS be in VMS text format.
David

leres@ucbarpa.Berkeley.EDU.UUCP (03/26/87)

Organization:


In article <986@epimass.UUCP> jbuck@epimass.UUCP (Joe Buck) writes:

>Also, doing random seeks and modifications to a file only works if
>it's in Unix format.

In article <17989@ucbvax.BERKELEY.EDU> I write:

>I disagree with the statement that random seeks only work with Unix files;

Then in article <999@epimass.UUCP> jbuck@epimass.UUCP (Joe Buck) writes:

>You misquoted (or rather, misparaphrased) me.  I said you can't
>UPDATE a "VMS format" file using random seeks (as in read-modify-write).

I think you misquote yourself. Forgive me for being so picky, but it's one
of my bad habits. (Excuse me now while I don my asbestos jump suit...)

		Craig