[Info-vax] proper format for JPEG files
Hein RMS van den Heuvel
heinvandenheuvel at gmail.com
Mon Jul 25 23:41:07 EDT 2011
On Jul 25, 8:15 pm, Jose Baars <peutba... at googlemail.com> wrote:
> On Jul 25, 11:50 pm, VAXman- @SendSpamHere.ORG wrote:
>
Bob> Multiple $GET, or if you really had to you could skip RMS and
do
Bob> a rather painfull $QIO.
Or use SYS$READ for something right between GET and QIO.
Brian>> I think my comment was way to subtle for c.o.v.
Clearly.
Brian > > Just $MODIFY the FAB to be FIXed 512. $REWIND your file and
start reading
Brian> > it as FIXed.
>
MG> Changing FAB rfm rat mrs and XABFHC lrl mrz atr fields and then a
MG> $REWIND doesn't fool RMS,
Of course not. And that's not what he wrote.
IF you call SYS$MODIFY you can instruct RMS to use other attributes.
$REWIND is optional.
The OpenVMS linker and debugger uses this to switch between fixed-512
for the main image to var for debugger.
> it happily reads 32767 length records from this (now fix512? ) file.
I guess I know what you mean, but it firmly believe you can only read
512 byte
records from a fix512 file. Now you can choose to glue them
together....
You may also want to try use UDF format and read more bytes per get,
yet retaining read-ahead (unlike SYS$READ)
> I checked some more, and fread doesn't produce an error reading such
> an illegal file,
No, it just silently corrupts the output (under circumstances)
> it (probably) simply skips the part of the record that is longer than
> 32767 bytes.
No.
> On my sample bad file it reads 3209728 bytes, where it reads 3215997
> from
> the file converted to fix512, missing out 6269.
Would those perhaps be the line terminator characters?
$ convert sys$input tmp.tmp/fdl="record; format stream_lf"
aap
noot
mies
$ dump/rec/wid=80 tmp.tmp
Dump of file TMP.TMP on 25-JUL-2011 22:26:49.63
File ID (23026,4141,0) End of file block 1 / Allocated 3
Record number 1 (00000001), 3 (0003) bytes, RFA(0001,0000,0000)
706161 aap............. 000000
Record number 2 (00000002), 4 (0004) bytes, RFA(0001,0000,0004)
746F6F6E noot............ 000000
Record number 3 (00000003), 4 (0004) bytes, RFA(0001,0000,0009)
7365696D mies............ 000000
$ write sys$output f$file("tmp.tmp", "ffb")
14
The CRTL does NOT use RMS record mode SYS$GET call for simple files.
It will use RMS SYS$READ and de-block and optionally corrupt data on
its own.
Cheers all,
Hein
More information about the Info-vax
mailing list