home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 263,249 of 264,096   
   =?UTF-8?Q?Arne_Vajh=C3=B8j?= to All   
   Re: Binutils   
   06 Sep 25 19:55:43   
   
   From: arne@vajhoej.dk   
      
   On 9/5/2025 10:07 PM, Lawrence D’Oliveiro wrote:   
   > On Fri, 5 Sep 2025 22:28:27 -0000 (UTC), Waldek Hebisch wrote:   
   >> Well, I would prefer to avoid discussions about what is content, what is   
   >> data and what is metadata.   
   >   
   > If you bypass RMS and read/write the file contents directly, what you have   
   > is “data”.   
      
   Read like this:   
      
   #include    
   #include    
   #include    
      
   #include    
   #include    
   #include    
   #include    
   #include    
   #include    
      
   int main(int argc, char *argv[])   
   {   
        long stat;   
        char *fnm = "var.txt";   
        char expfnm[NAM$C_MAXRSS];   
        struct FAB fab = cc$rms_fab;   
        struct NAM nam = cc$rms_nam;   
        fab.fab$l_fna = (char *)fnm;   
        fab.fab$b_fns = strlen(fnm);   
        fab.fab$b_fac = FAB$M_GET;   
        fab.fab$l_nam = &nam;   
        nam.nam$b_rss = sizeof(expfnm) - 1;   
        nam.nam$l_rsa = expfnm;   
        stat = sys$open(&fab, 0, 0);   
        //printf("stat = %d\n", stat);   
        stat = sys$close(&fab, 0, 0);   
        //printf("stat = %d\n", stat);   
        struct dsc$descriptor_s devdesc;   
        devdesc.dsc$b_dtype = DSC$K_DTYPE_T;   
        devdesc.dsc$b_class = DSC$K_CLASS_S;   
        devdesc.dsc$w_length = strlen(expfnm);   
        devdesc.dsc$a_pointer = expfnm;   
        short chan;   
        stat = sys$assign(&devdesc, &chan, 0, 0, 0);   
        //printf("stat = %d\n", stat);   
        struct fibdef fib;   
        long fibdesc[] = { FIB$K_LENGTH, (long)&fib };   
        memset(&fib, 0, sizeof(fib));   
        fib.fib$w_fid[0] = nam.nam$w_fid[0];   
        fib.fib$w_fid[1] = nam.nam$w_fid[1];   
        fib.fib$w_fid[2] = nam.nam$w_fid[2];   
        unsigned short iosb[4];   
        stat = sys$qiow(0, chan, IO$_ACCESS | IO$M_ACCESS, iosb, 0, 0,   
   &fibdesc, 0, 0, 0, 0, 0);   
        //printf("stat = %d\n", stat);   
        char buf[512];   
        int ix = 0;   
        for(;;)   
        {   
            ix++;   
            stat = sys$qiow(0, chan, IO$_READVBLK, iosb, 0, 0, buf, 512,   
   ix, 0, 0, 0);   
            if(iosb[0] == SS$_ENDOFFILE) break;   
            //printf("stat = %d iosb[0] = %d\n", stat, iosb[0]);   
            for(int i = 0; i < iosb[1]; i++)   
            {   
                printf(" %02X", buf[i]);   
                if(((i + 1) % 16) == 0) printf("\n");   
            }   
        }   
        stat = sys$qiow(0, chan, IO$_DEACCESS, iosb, 0, 0, &fibdesc, 0, 0,   
   0, 0, 0);   
        //printf("stat = %d\n", stat);   
        stat = sys$dassgn(chan);   
        //printf("stat = %d\n", stat);   
        return 0;   
   }   
      
   ?   
      
   I don't think the output from this will be considered the   
   file content by many.   
      
   :-)   
      
   Arne   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca