comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: Porting VMS "writeu" files to UNIX

Re: Porting VMS "writeu" files to UNIX
type: item
description: In article <gotwols.719353668@warper.jhuapl.edu> gotwols@warper.jhuapl.edu (Bruce Gotwols) writes: > I have found that it is very difficult to port IDL files made using > unformatted writes (eg. writeu,1,buf) to other systems such as UNIX. The > culprit seems to be that under VMS these files have a record attribute of > implied carriage return. If I Kermit the files (having set binary) I get an > irrelevant line feed (ironically not a carriage return) at the end of each > record. Does anyone have a suggestion? > Thanks, bruce > -- Try using the XDR keyword when opening the file with OPENU. This makes the file a standard format that is portable between machines. -Kirk
creator: benell
date: 1992-10-18T15:46:01-00:00

Re: Porting VMS "writeu" files to UNIX
type: item
description: In article <gotwols.719353668@warper.jhuapl.edu>, gotwols@warper.jhuapl.edu (Bruce Gotwols) writes... > I have found that it is very difficult to port IDL files made using > unformatted writes (eg. writeu,1,buf) to other systems such as UNIX. The > culprit seems to be that under VMS these files have a record attribute of > implied carriage return. If I Kermit the files (having set binary) I get an > irrelevant line feed (ironically not a carriage return) at the end of each > record. Does anyone have a suggestion? You might use the /NONE keyword on the OPENW call. This should solve your immediate problem. As has already been pointed out, one could use XDR when opening the file for read and write. This should make the file completely transportable. However, the record attribute is still Carriage-Return-Carriage-Control, so you may still have problems. Also, this does put some restrictions on the kind of I/O you can and cannot do with the file. In particular, you can't write fixed-length record (direct access) files, which I like to use. I've had good luck writing transportable files using the following technique. 1. Open the file with the /BLOCK keyword set (then /NONE not needed). 2. Use the BYTEORDER routine to convert the data to or from network format (e.g. using the HOST_TO_IEEE and IEEE_TO_HOST routines below) before writing or after reading the data. 3. Use only READU and WRITEU for I/O. 4. Use POINT_LUN to go directly to any desired point in the file. The disadvantage of this approach is that it doesn't allow you to use any of the VMS record-oriented services. However, you can't use them on UNIX machines anyways. Bill Thompson ============================================================ =================== PRO HOST_TO_IEEE, DATA, DATATYPE=DATATYPE ;+ ; NAME: ; HOST_TO_IEEE ; PURPOSE: ; To translate an IDL variable in the host architecture into the IEEE-754 ; standard (e.g. as used in FITS files). ; CALLING SEQUENCE: ; HOST_TO_IEEE, DATA ; INPUT/OUTPUT PARAMETE…
creator: thompson
date: 1992-10-19T14:34:00-00:00