[mod.computers.vax] Converting Stream_LF files?

OC.PEDHEM@CU20B.COLUMBIA.EDU ("Christopher Lent") (10/24/86)

Hi,
	Does anyone have a program or FDL file to convert a Stream_Lf file to
a nice  normal file so that commands like TYPE FOO.BAR and COPY FOO.BAR TT:
will work?  Any language would be instructive.

Thanks,
Chris Lent
OC.PEDHEM@CU20B.COLUMBIA.EDU
or
ihnp4!allegra!phri!cooper!chris
(203) 452-1522
-------

campbell@maynard.UUCP (10/25/86)

In article <12249233250.11.OC.PEDHEM@CU20B.COLUMBIA.EDU> cooper!chris writes:
>Hi,
>	Does anyone have a program or FDL file to convert a Stream_Lf file to
>a nice  normal file so that commands like TYPE FOO.BAR and COPY FOO.BAR TT:
>will work?  Any language would be instructive.

You must be running some ancient version of VMS;  under (at least) 4.2, 4.3,
and 4.4, TYPE works just fine on STMLF files.

-- 
Larry Campbell       MCI: LCAMPBELL          The Boston Software Works, Inc.
UUCP: {alliant,wjh12}!maynard!campbell      120 Fulton Street, Boston MA 02109
ARPA: campbell%maynard.uucp@harvisr.harvard.edu     (617) 367-6846

egisin%watmath.waterloo.edu@RELAY.CS.NET (Eric Gisin) (10/25/86)

> Hi,
> 	Does anyone have a program or FDL file to convert a Stream_Lf file to
> a nice  normal file so that commands like TYPE FOO.BAR and COPY FOO.BAR TT:
> will work?  Any language would be instructive.
> 
> Thanks,
> Chris Lent

The only problems I've seen with stream-lf file occur when the file
doesn't have a newline as the final character or when a record
(delimited by newlines) is too big for the application's buffer.
The first case can be checked and fixed with a simple program in C:
	/* the following return values should be check for errors */
	f = fopen(file, "r+w");
	fseek(f, -1, 2);	/* seek to last byte */
	if (getc(f) != '\n') {
		fprintf(stderr, "Appended \\n\n");
		fseek(f, 0, 2);	/* seek to EOF */
		putc('\n', f);
	}
	fclose(f);
I haven't tested the above, and seem to recall VAXC IO may have some bugs
regarding "r+w" file access.

Are there any other problems with stream-lf file created by C?
I've used them extensively (on VMS V4).  Note the message EDT
gives when editing a stream-lf file is just a meaningless warning.

	Eric Gisin, egisin@math.waterloo.{csnet,edu}

levy@ttrdc.UUCP.UUCP (10/27/86)

In article <8610260459.AA20437@ucbvax.Berkeley.EDU>, egisin%watmath.waterloo.edu@RELAY.CS.NET (Eric Gisin) writes:
>Are there any other problems with stream-lf file created by C?
>I've used them extensively (on VMS V4).  Note the message EDT
>gives when editing a stream-lf file is just a meaningless warning.
>
>	Eric Gisin, egisin@math.waterloo.{csnet,edu}

In the not too distant past, I remember problems with getting VMS Fortran
programs to read stream-lf files put out by VMS C programs (the Fortran code
would stack dump).  However I just now tried it and it seems to work fine
(VMS 4.3, C 2.0, Fortran ???).  Maybe something has been fixed or improved
since 4.2 (or earlier)?

--
 -------------------------------    Disclaimer:  The views contained herein are
|       dan levy | yvel nad      |  my own and are not at all those of my em-
|         an engihacker @        |  ployer or the administrator of any computer
| at&t computer systems division |  upon which I may hack.
|        skokie, illinois        |
 --------------------------------   Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa,
	   go for it!  			allegra,ulysses,vax135}!ttrdc!levy

LEICHTER-JERRY@YALE.ARPA (10/27/86)

    Hi,
    	Does anyone have a program or FDL file to convert a Stream_Lf file to
    a nice  normal file so that commands like TYPE FOO.BAR and COPY FOO.BAR TT:
    will work?  Any language would be instructive.
Back in V3 of VMS, STREAM_LF files didn't work correctly through DECnet.  Ever
since V4, I have seen no problems with using them with all the usual cast of
programs.  Certainly, TYPE and COPY deal with them just fine.

The easiest way to build an FDL file for such a conversion, should you really
want to do it, is simply to do an ANALY/RMS/FDL=xxx on a file with the desired
characteristics!  (You might want to edit he result to take out anything like
a pre-extension that you don't want.)
							-- Jerry
-------

KARNEY%PPC.MFENET@LLL-MFE.ARPA (10/29/86)

This is how I do this:

In my LOGIN.COM file, I define
  $ CONV_TO_TEXT == "CONVERT/FDL=EMACS_DIR:VAR"

EMACS_DIR:VAR.FDL contains
*** beginning of VAR.FDL ***
SYSTEM
        SOURCE                  VAX/VMS

FILE
        ORGANIZATION            sequential

RECORD
        BLOCK_SPAN              yes
        CARRIAGE_CONTROL        carriage_return
        FORMAT                  variable
        SIZE                    0
*** end of VAR.FDL ***

Then
  $ CONV_TO_TEXT <input-file> <output-file>
converts <input-file> to a "standard" VAX text file <output-file>.
                        ---Charles Karney
                           Karney%PPC@LLL-MFE