T.R | Title | User | Personal Name | Date | Lines |
---|
174.1 | | MARRHQ::RMURPHY | | Thu Oct 31 1985 21:21 | 9 |
| You need the XAB LRL field set at $CREATE time (as you have probably guessed).
WAG: Isn't there an ACP function to read/write the file characteristics?
That could be used...
I have some code that does file transfers over async lines that preserves
the characteristics; it opens the input file with a FAB/RAB/XAB combination,
and sends along the characteristics necessary for the corresponding output
file stuff. Written in MACRO; send me MAIL if you're interested in looking
at the code.
-Rick
|
174.2 | | LEROUF::HEIN | | Fri Nov 01 1985 09:17 | 12 |
| The LRL is 'maintained' by rms, it is not something you should 'set'.
I think LRL=MAX(LRL,RSZ), where RSZ is the record size field in the
RAB being processed by SYS$PUT. I realize now the the basenote mentioned
using SYS$WRITE, not SYS$PUT. Is that right Martin? Are you formatting
records in blocks your-self? maintaining record length fields and all that?
If this is true, and since this is the hackers files, you might want to
try, after you inserted your last record, and while maintaining the
longest seen record yourself; DISCONNECT, CONNECT with RECORD I/O mode
(the default) and to EOF, SYS$PUT anything with length equal to the
max rec len that you found, re-position using the RFA from the PUT,
and TRUNCATE the file, thereby effectivly deleting the dummy 'longest record'.
|
174.3 | | REX::MINOW | | Fri Nov 01 1985 11:27 | 22 |
| Ayup, I'm writing using sys$write -- since the FDL routines supposedly
transfer the file header stuff, all I need to do is to stuff the bits
onto the disk (I do no interpretation of the data).
Trouble is, FDL doesn't give me the XABFHC LRL field and, as noted,
I haven't found out how to set it myself on a file I didn't create.
The hack in .2 where I add an extra record is going to fail badly if
the decompressed file just fits on the output disk and the longest
record causes it to slop over.
Now, (putting my naive hat on again), the "put" routine must do something
with it's concept of "longest record" AFTER the file is created, and
BEFORE it is closed. It's this magic -- assuming mere mortals can
understand it -- that I need.
Hmm, perhaps I should sys$put the longest record FIRST, then rewind the
file?
Still confused.
Martin.
|
174.4 | | R2ME2::GILBERT | | Fri Nov 01 1985 16:41 | 8 |
| Have you tried doing a QIO(W) access and deaccess to the file, specifying the
record attribute area as one of the attribute descriptors, and setting the
FAT$W_MAXLEN field to the LRL value you want the file to have? Just wondering.
Also, instead of using RMS to SYS$WRITE the file contents, you might consider
opening the file (via RMS) with the FAB$V_UFO option (the channel number is
returned in FAB$L_STV), and writing the file with QIO(W)s. The difference
in overhead is negligable, but more importantly, you have the channel number.
|
174.5 | | REX::MINOW | | Fri Nov 01 1985 16:48 | 31 |
| Thanks for the help. I ended up using the hack suggested earlier --
stuffing a dummy "longest" record and rewinding. The relevant
code is appended -- it should be fairly easy to follow. If not, you
are welcome join me in longing for the days of RSTS/E and RT11.
Martin.
r->fab.fab$b_fac =
(xab_lrl == 0) ? FAB$M_PUT | FAB$M_BIO
: FAB$M_PUT | FAB$M_BRO;
if ((fdl_status = sys$open(&r->fab)) != RMS$_NORMAL) {
return (fail(r, "opening created file", NULL));
}
if (xab_lrl != 0) {
extern char outbuffer[MAXIO]; /* Handy buffer to use */
r->rab.rab$l_rop = 0; /* PUT I/O */
if ((fdl_status = sys$connect(&r->rab)) != RMS$_NORMAL)
return (fail(r, "connect after create, setting length", NULL));
r->rab.rab$l_rbf = outbuffer; /* Put a dummy */
r->rab.rab$w_rsz = xab_lrl; /* longest record */
if ((fdl_status = sys$put(&r->rab)) != RMS$_NORMAL)
return (fail(r, "putting longest record", NULL));
if ((fdl_status = sys$rewind(&r->rab)) != RMS$_NORMAL)
return (fail(r, "rewinding after long record hack", NULL));
if ((fdl_status = sys$disconnect(&r->rab)) != RMS$_NORMAL)
return (fail(r, "disconnecting after setting length", NULL));
}
r->rab.rab$l_rop = RAB$M_BIO; /* Block I/O only */
if ((fdl_status = sys$connect(&r->rab)) != RMS$_NORMAL)
return (fail(r, "connecting after create", NULL));
|
174.6 | | DIEVMS::HERBERT | | Mon Nov 04 1985 13:52 | 4 |
| Longing for the days of RSTS? They are still here.
Kevin Herbert
RSTS/E Development
|
174.7 | | LEROUF::HEIN | | Tue Nov 05 1985 05:18 | 11 |
| Glad to see it worked! Remote brainstorming strikes again :-)
Should have thought about PUTthe longest record first, and then
WRITing the real data to the file myself! But then, I did not
know you knew the LRL while starting to work on the output file.
Martin, You probably do not need the REWIND. An DISCONNECT followed
by a CONNECT as your code does, will 'rewind' the file for you.
And on top of that, you could specify the VBN on the first WRITE.
Hein.
|
174.8 | | REX::MINOW | | Tue Nov 05 1985 16:02 | 6 |
| Fixed the "can't create ISAM file bug", thanks to BISTRO::HEIN.
As usual, informal channels are alive and well at Dec.
Thanks for the help.
Martin.
|