From: arne@vajhoej.dk   
      
   On 9/5/2025 1:40 PM, Waldek Hebisch wrote:   
   > Arne Vajhøj wrote:   
   >> I was not talking about file padding but about record   
   >> padding.   
   >>   
   >> I think this illustrate the issue:   
   >>   
   >> $ write sys$output f$file("z.txt","rfm"),f$file("z.txt","mrs")   
   >> FIX2   
   >> $ typ z.txt   
   >> AB   
   >> CD   
   >> EF   
   >> $ set file/attr=(mrs:1) z.txt   
   >> $ write sys$output f$file("z.txt","rfm"),f$file("z.txt","mrs")   
   >> FIX2   
   >> $ set file/attr=(lrl:1) z.txt   
   >> $ write sys$output f$file("z.txt","rfm"),f$file("z.txt","mrs")   
   >> FIX1   
   >> $ typ z.txt   
   >> A   
   >> C   
   >> E   
   >>   
   >> B, D and F are "lost".   
   >>   
   >> And it looks like one need to set LRL instead of MRS to change the file.   
   >   
   > I am not sure what this is supposed to ilustrate. I mean, I would   
   > expect that changing record length below previous record length   
   > and doing no other changes to attributes will lead to trouble   
   > and while I do not undertand all details of your example, it seem   
   > to confirm my expectation.   
      
   It illustrates that:   
      
   $ set file/attr=(rfm:fix,lrl:oddnumber) ...   
      
   is very dangerous, because some data bytes may end up being lost due   
   to being considered padding.   
      
   > I would expect that having records   
   > of length 3 and then setting length to 2 would also truncate   
   > data in the records.   
      
   $ set file/attr does not change the content of the file only the   
   file header meta data.   
      
   AAA   
   BBB   
   CCC   
      
   41 41 41 00   
   42 42 42 00   
   43 43 43 00   
      
   does not become:   
      
   AA   
   BB   
   CC   
      
   41 41   
   42 42   
   43 43   
      
   but:   
      
   AA   
   A*   
   BB   
   B*   
   CC   
   C*   
      
   41 41   
   41 00   
   42 42   
   42 00   
   43 43   
   43 00   
      
   Arne   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|