[comp.sys.apollo] Help requested for file conversions

kerr@tron.UUCP (Dave Kerr) (05/31/89)

I have the following problem and was hoping someone here would have already
solved it. I have files created on an apollo by the Mentor Graphics CAD
software packages. These files represent schematics and other misc.
documentation. Many of the files are of type rec, or hdru. I would like to
find a way to convert these into a form that is suitable for E-mailing to
another site. I have tried the cvt_rec_uasc command but found that
converting a file, then "un-converting" it yields a file that differs from
the original. So my question is:

How do I convert a typed file into a regular ascii file (which I can
uuencode and mail) and then convert it back to a typed file after receipt on
a remote system?

Thanks in advance.
-- 
Dave Kerr (301) 765-4453
kerr%tron.UUCP@umbc3.UMBC.EDU             from an Internet site
kerr@tron.UUCP                            from a smart uucp mailer
{well-connected-site}!netsys!tron!kerr    from a dumb  uucp mailer

krowitz@RICHTER.MIT.EDU (David Krowitz) (05/31/89)

You can do it with a relatively short program ... (which I
haven't gotten around to writing yet, of course)

Use the IOS_$INQ_TYPE_UID call to get the file's object type.
Then use the mapped segment calls (the MS_$ calls) to open
and read the entire file (including the 32-byte header) into
a buffer. Use the IOS_$CREATE call to create an ascii file
and then write the object type and the data from the 
original file into this ascii file and close it. You can
then use uuencode and mail the file. When the file is
received, you go through the reverse process (uudecode, open
the ascii file and read the object type and the data, use
IOS_$CREATE to create a file of the proper type and use
the MS_$ calls to write the data into the file).


 -- David Krowitz

krowitz@richter.mit.edu   (18.83.0.109)
krowitz%richter@eddie.mit.edu
krowitz%richter@athena.mit.edu
krowitz%richter.mit.edu@mitvma.bitnet
(in order of decreasing preference)

rudy@neptune.AMD.COM (Rudy Albachten) (06/01/89)

In article <422@tron.UUCP> kerr@tron (Dave Kerr) writes:
>I have files created on an apollo by the Mentor Graphics CAD
>software packages. Many of the files are of type rec, or hdru.
>I would like to find a way to convert these into a form that is
>suitable for E-mailing to another site.
>

We have encountered a similar problem moving designs from one
site to another that is only networked via traditional TCP/IP.
What we do is make a backup file using iwbak then ftp the
backup file and use irbak to restore it. The apollo wbak and
rbak commands only read/write tapes, but mentor has iwbak/irbak
available. These commands can also read/write backup files as
well as tapes. You should be able to encode/decode these files
and mail them. If anyone uses iwbak/irbak for ftp-ing things,
one gotcha to watch for: you can use binary mode OR ascii mode,
but if you store it on a remote computer then fetch it from
that computer, you must use the same mode both times.

Does anyone know if apollo plans to supply a wbak-like command
that can use files or stdio like tar can? I don't want tar, since
it doesn't understand apollo's file types (and I do like having
all those file types). We currently use SR9.7, so forgive me
if it's already in SR10. (We'll be upgrading to SR10.1 real soon.)

Rudy Albachten            rudy@amdcad.amd.com
Advanced Micro Devices    512/462-5118
Austin Texas

bhv@igloo.Scum.COM (Bronis Vidugiris) (06/01/89)

In article <422@tron.UUCP> kerr@tron (Dave Kerr) writes:
)I have the following problem and was hoping someone here would have already
)solved it. I have files created on an apollo by the Mentor Graphics CAD
)software packages. These files represent schematics and other misc.
)documentation. Many of the files are of type rec, or hdru. I would like to
)find a way to convert these into a form that is suitable for E-mailing to
)another site. I have tried the cvt_rec_uasc command but found that
)converting a file, then "un-converting" it yields a file that differs from
)the original. So my question is:
)
)How do I convert a typed file into a regular ascii file (which I can
)uuencode and mail) and then convert it back to a typed file after receipt on
)a remote system?

The new version of  wbak (starting at 9.7, I believe) can archive
an entire directory tree (including, of course, the mentor format picture
files) into a file.  [The old version of rbak/wbak would back up only onto
a tape].  This file can then be sent wherever desired in the network, and
restored using rbak.

We send information this way [including schematics] frequently.
-- 
bhv@igloo

brian@apollo.COM (Brian Holt) (06/02/89)

In article <422@tron.UUCP> kerr@tron (Dave Kerr) writes:
>How do I convert a typed file into a regular ascii file (which I can
>uuencode and mail) and then convert it back to a typed file after receipt on
>a remote system?

If you are running on sr10 or later, tar -A will save the 
Apollo specific type and record information in a standard
format tar archive (it actually puts two entries into the 
archive for each typed file).  You can than uuencode the
tar file and mail it, and at the other end uudecode it 
and untar it.  If you untar it on an Apollo, you will get the
typed file.  If you untar it on anything else you'll get
a regular file full of bytes of garbage.

		=brian
-- 
UUCP:     {decvax,mit-eddie,umix}!apollo!brian
Internet: brian@apollo.COM   [ I wonder when this will become apollo.hp.com...]
QOTD:     "An employee of the Apollo Division of the Hewlett-Packard Company"

weber_w@apollo.COM (Walt Weber) (06/07/89)

In article <1508@igloo.Scum.COM> bhv@igloo.UUCP (Bronis Vidugiris) writes:
>The new version of  wbak (starting at 9.7, I believe) can archive
>. . . .into a file.  [The old version of rbak/wbak would back up only onto
>a tape].  This file can then be sent wherever desired in the network, and
>restored using rbak.

A minor clarification.  The versions of wbak and rbak which do this are NOT
included with sr9.7, but were made available through the patch tape mechanism.
These features are included as part of the standard Domain/OS releases of these
commands.

*** Please note that this patch violated a widely-accepted rule - "no new
    functionality in patches".  There were compelling reasons to do this, but
    in the general case you will not see this behavior.

For easy reference, here is the section from the patch tape release notes
covering the patch.  (Personal note: this is NOT MEANT to reopen the issues
about patch distribution and posting of release notes.)

...walt...

Patch 116 Enchancements to WBAK, RBAK, and RWMT 
Patch  116  adds  new functionality to WBAK, RBAK, and RWMT for 9.7.  RBAK and
WBAK  now  support  disk   files   as   backup   sources   and   destinations.
Specifically,  WBAK  supports  the  following  types  of  files  as   possible
destinations of backup output: 

     o  Disk files 

     o  Typed objects

     o  'Standard out'

RBAK supports the following types of files   as  possible  sources  of  backup
input:

     o  Disk files

     o  Typed objects 

     o  'Standard in' 


For  more information, see the -to, -type, -r, and -stdout options in the WBAK
help file and the -from and -stdin options in the RBAK help file. 

In addition, an option has been added  to  RWMT  to  disable   byte  swapping.
This  option  is  needed when transferring backup output previously written to
disk (using the new WBAK feature) to  magnetic  tape,  so  that  the  tape  is
written  in  the  format required by a subsequent RBAK.  For more information,
see the -nobs option in the RWMT help file. 

-- 
Walt Weber                    Apollo Computer
(508) 256-6600 x8315          People's Republic of Massachusetts
-The views expressed herein are personal, and not binding on ANYONE-