From help-octave-request at che dot utexas dot edu Mon Jan 23 05:15:44 1995 Subject: Re: Raw file i/o From: guido at aia dot RWTH-Aachen dot DE (Guido Dietz) To: jwe at che dot utexas dot edu Cc: help-octave at che dot utexas dot edu Date: Mon, 23 Jan 1995 12:14:44 +0100 You wrote: >One thing I would like to add is to add an optional third argument to >fopen() that would set the default conversion type. The argument >should be a string, and should be compatible with the way Matlab >works (this is from the Matlab help and was posted to >comp.soft-sys.matlab this week): > >[FID, MESSAGE] = FOPEN('filename',permission, machineformat) opens the > specified file with the specified permission and treats data read > using FREAD or data written using FWRITE as having a format given > by machineformat. machineformat is one of the following strings: > > 'native' or 'n' - local machine format - the default > 'ieee-le' or 'l' - IEEE floating point with little-endian > byte ordering > 'ieee-be' or 'b' - IEEE floating point with big-endian > byte ordering > 'vaxd' or 'd' - VAX D floating point and VAX ordering > 'vaxg' or 'g' - VAX G floating point and VAX ordering > 'cray' or 'c' - Cray floating point with big-endian > byte ordering > 'ieee-le.l64' or 'a' - IEEE floating point with little-endian > byte ordering and 64 bit long data type > (currently supported on: alpha, sgi, ibm_rs, > hp300, vax, and cray platforms only) > >Perhaps the strings you have chosen for the new built-in variables >should be changed to match these (or at least accept them too). > >: After some testings (two or three days) I will send you a patch and >: hope that you will add it to the next release. > >Thanks, I'm looking forward to seeing them. > >jwe I reckon this is a good idea: I am just working on it. The builtin variable 'raw_io_format' I put in the waste paper basket. Therefore the new method: * Extracting and modifying the int and float conversion routines from "src/load-save.cc" to "liboctave/FConc.cc", "liboctave/FConc.h" and "liboctave/FSwap.h". Changes in "liboctave/Makefile.in". * implementing the conversion routines in "liboctave/dMatrix.cc". * adding 'file_arch' and others to the file_info structure and modifying the 'fopen*' calls as well as 'fread_internal' and 'fwrite_internal' in "src/load-save.cc". Only for the 'ieee-le.l64' I am to lazy, but I hope you'll respond: >I wouldn't worry too much about this. Perhaps someone who has a need >for these conversions will eventually implement them. as in the last mail! Bye bye G. --