<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Read a locked file... in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993769#M23313</link>
    <description>Hein,&lt;BR /&gt;  parhaps you can add some comments and submit it at dcl.openvms.org&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 31 Jul 2006 08:19:46 GMT</pubDate>
    <dc:creator>Ian Miller.</dc:creator>
    <dc:date>2006-07-31T08:19:46Z</dc:date>
    <item>
      <title>Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993758#M23302</link>
      <description>Hello, I've some problems trying to read a locked file, the problem I have is that the file appears like&lt;BR /&gt;&lt;BR /&gt;FILE.LOG    0/144&lt;BR /&gt;&lt;BR /&gt;When I do a DIR FILE.LOG/SIZE=ALL.&lt;BR /&gt;&lt;BR /&gt;This file is created with the command&lt;BR /&gt;&lt;BR /&gt;SET H 0/LOG=FILE.LOG&lt;BR /&gt;&lt;BR /&gt;The BACKUP/IGNORE=INTERLOCK command creates a file with 0 blocks and nothing into the file.&lt;BR /&gt;&lt;BR /&gt;The command CONVERT/SHARE doesn't run here.&lt;BR /&gt;&lt;BR /&gt;The EDIT/TPU/READ results are like the BACKUP command.&lt;BR /&gt;&lt;BR /&gt;Any body knows any way to take the data from the memory region where are this file and put those data to a new file???&lt;BR /&gt;And how can I know in wich memory region are the file data???&lt;BR /&gt;&lt;BR /&gt;Many thanks in advance.&lt;BR /&gt;&lt;BR /&gt;Juan</description>
      <pubDate>Fri, 28 Jul 2006 04:51:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993758#M23302</guid>
      <dc:creator>Juan M. Lazaro</dc:creator>
      <dc:date>2006-07-28T04:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993759#M23303</link>
      <description>Hi Juan&lt;BR /&gt;&lt;BR /&gt;If this file is the output log from a set host/log command, is the set host session stil active ? If yes, do a logout and you will be able to read the file.&lt;BR /&gt;&lt;BR /&gt;Otherwise you could try a &lt;BR /&gt;&lt;BR /&gt;$ set file/end sethost.log&lt;BR /&gt;&lt;BR /&gt;hopefuly that helps&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;&lt;BR /&gt;Heinz</description>
      <pubDate>Fri, 28 Jul 2006 05:20:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993759#M23303</guid>
      <dc:creator>Heinz W Genhart</dc:creator>
      <dc:date>2006-07-28T05:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993760#M23304</link>
      <description>Hi Heinz,&lt;BR /&gt;&lt;BR /&gt;The problem is that I want read it without a logout, I've tried the command&lt;BR /&gt;&lt;BR /&gt;set file/end file.log&lt;BR /&gt;&lt;BR /&gt;But I've the next errors&lt;BR /&gt;&lt;BR /&gt;%E, error reading GLOG:[OPER.LOG]FILE.LOG;1&lt;BR /&gt;%W, file access conflict&lt;BR /&gt;&lt;BR /&gt;And the file appears empty...&lt;BR /&gt;&lt;BR /&gt;Thanks in any case.&lt;BR /&gt;&lt;BR /&gt;Juan</description>
      <pubDate>Fri, 28 Jul 2006 05:30:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993760#M23304</guid>
      <dc:creator>Juan M. Lazaro</dc:creator>
      <dc:date>2006-07-28T05:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993761#M23305</link>
      <description>Juan,&lt;BR /&gt;&lt;BR /&gt;the data can be found in memory (in the RMS BDBs) and also on disk (after it has been flushed, which happens from time to time). You could just look at the hex/ASCII dump of the data in the file this way:&lt;BR /&gt;&lt;BR /&gt;$ ANAL/SYS&lt;BR /&gt;SDA&amp;gt; SET PROC/IND=&lt;PID-OF-PROCESS-RUNNING-SET_HOST&gt;&lt;BR /&gt;SDA&amp;gt; SHOW PROC/RMS=BDBSUM&lt;BR /&gt;SDA&amp;gt; EXA addr;size&lt;BR /&gt;&lt;BR /&gt;Take the value addr from column ADDR and the value for size from the column SIZE&lt;BR /&gt;&lt;BR /&gt;SDA&amp;gt; SHOW PROC/RMS=WCB&lt;BR /&gt;&lt;BR /&gt;This will show you the WCB (Window Control Block) address of the file.&lt;BR /&gt;&lt;BR /&gt;SDA&amp;gt; CLUE XQP/FILE=&lt;WCB-ADDRESS&gt;&lt;BR /&gt;will list the File Header LBN (HdLBN) on the disk:&lt;BR /&gt;&lt;BR /&gt;$ DUMP/BL=(COUNT=1,START=%X&lt;FILE-HEADER-LBN&gt;/FILE disk:&lt;BR /&gt;&lt;BR /&gt;will dump and format the file header, which includes the Map Area (Retrieval pointers), which give you the LBN and size of each extent of the file on disk.&lt;BR /&gt;&lt;BR /&gt;$ DUMP/BL=(count=size,START=%Xlbn) disk:&lt;BR /&gt;&lt;BR /&gt;will then dump HEX/ASCII the contents of the file extents.&lt;BR /&gt;&lt;BR /&gt;It can be done, but it's not easy.&lt;BR /&gt;&lt;BR /&gt;Volker.&lt;/FILE-HEADER-LBN&gt;&lt;/WCB-ADDRESS&gt;&lt;/PID-OF-PROCESS-RUNNING-SET_HOST&gt;</description>
      <pubDate>Fri, 28 Jul 2006 05:55:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993761#M23305</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2006-07-28T05:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993762#M23306</link>
      <description>Hi Wolker,&lt;BR /&gt;&lt;BR /&gt;First, many thanks about your answer, but I have had a problem in the last command,&lt;BR /&gt;&lt;BR /&gt;The command output of &lt;BR /&gt;&lt;BR /&gt;DUMP/BL=(COUNT=1,START=%X&lt;FILE-HEADER-LBN&gt;/FILE disk:&lt;BR /&gt;&lt;BR /&gt;is:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Dump of device $1$DGA107: on 28-JUL-2006 13:15:26.50&lt;BR /&gt;&lt;BR /&gt;Logical block number 4530 (000011B2), 512 (0200) bytes&lt;BR /&gt;&lt;BR /&gt;Header area&lt;BR /&gt;    Identification area offset:           40&lt;BR /&gt;    Map area offset:                      100&lt;BR /&gt;    Access control area offset:           255&lt;BR /&gt;    Reserved area offset:                 255&lt;BR /&gt;    Extension segment number:             0&lt;BR /&gt;    Structure level and version:          2, 1&lt;BR /&gt;    File identification:                  (1768,9,0)&lt;BR /&gt;    Extension file identification:        (0,0,0)&lt;BR /&gt;    VAX-11 RMS attributes&lt;BR /&gt;        Record type:                      Variable&lt;BR /&gt;        File organization:                Sequential&lt;BR /&gt;        Record attributes:                Implied carriage control&lt;BR /&gt;        Record size:                      0&lt;BR /&gt;        Highest block:                    144&lt;BR /&gt;        End of file block:                1&lt;BR /&gt;        End of file byte:                 0&lt;BR /&gt;        Bucket size:                      0&lt;BR /&gt;        Fixed control area size:          0&lt;BR /&gt;        Maximum record size:              0&lt;BR /&gt;        Default extension size:           0&lt;BR /&gt;        Global buffer count:              0&lt;BR /&gt;        Directory version limit:          0&lt;BR /&gt;    File characteristics:                 &lt;NONE specified=""&gt;&lt;BR /&gt;    Caching attribute:                    Writethrough&lt;BR /&gt;    Map area words in use:                2&lt;BR /&gt;    Access mode:                          0&lt;BR /&gt;    File owner UIC:                       [1,4]&lt;BR /&gt;    File protection:                      S:RWED, O:RWED, G:RE, W:&lt;BR /&gt;    Back link file identification:        (504,1,0)&lt;BR /&gt;    Journal control flags:                &lt;NONE specified=""&gt;&lt;BR /&gt;    Active recovery units:                None&lt;BR /&gt;    File entry linkcount:                 0&lt;BR /&gt;    Highest block written:                144&lt;BR /&gt;    Client attributes:                    None&lt;BR /&gt;&lt;BR /&gt;Identification area&lt;BR /&gt;    File name:                            FILE.LOG;1&lt;BR /&gt;    Revision number:                      3&lt;BR /&gt;    Creation date:                        28-JUL-2006 09:48:16.59&lt;BR /&gt;    Revision date:                        28-JUL-2006 09:55:35.44&lt;BR /&gt;    Expiration date:                      &lt;NONE specified=""&gt;&lt;BR /&gt;    Backup date:                          &lt;NONE specified=""&gt;&lt;BR /&gt;&lt;BR /&gt;Map area&lt;BR /&gt;    Retrieval pointers&lt;BR /&gt;        Count:        144        LBN:    1539378&lt;BR /&gt;&lt;BR /&gt;Checksum:                                 57158&lt;BR /&gt;&lt;BR /&gt;Then the last comand must be?&lt;BR /&gt;&lt;BR /&gt;DUMP/BL=(count=144,START=%X1539378) $1$dga107:&lt;BR /&gt;&lt;BR /&gt;Because it appears empty...&lt;BR /&gt;&lt;BR /&gt;Many thanks again...&lt;BR /&gt;&lt;BR /&gt;Juan&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/FILE-HEADER-LBN&gt;</description>
      <pubDate>Fri, 28 Jul 2006 06:21:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993762#M23306</guid>
      <dc:creator>Juan M. Lazaro</dc:creator>
      <dc:date>2006-07-28T06:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993763#M23307</link>
      <description>Juan,&lt;BR /&gt;&lt;BR /&gt;sorry, my fault.&lt;BR /&gt;&lt;BR /&gt;The LBN number from DUMP/FILE_HEADER is in decimal, so you must specify:&lt;BR /&gt;&lt;BR /&gt;$ DUMP/BL=(count=144,START=1539378) $1$dga107:&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
      <pubDate>Fri, 28 Jul 2006 06:26:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993763#M23307</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2006-07-28T06:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993764#M23308</link>
      <description>This problem has previously been discussed here.&lt;BR /&gt;Google: +site:itrc.hp.com +backup +locked&lt;BR /&gt;This gives:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=970391" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=970391&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And to a lesser degree in:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums2.itrc.hp.com/service/forums/questionanswer.do?threadId=656460" target="_blank"&gt;http://forums2.itrc.hp.com/service/forums/questionanswer.do?threadId=656460&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=990678" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=990678&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The data is probably on the disk, except for the last buffer.&lt;BR /&gt;&lt;BR /&gt;IMHO this design choice in backup is wrong / a bug. It should either just copy the block irrespective of the EOF mark as the EOF mark really is strictly optional as far as the file system is concerned. Private applications can set of not set a reasonable EOF as they please. RMS does rely on it.&lt;BR /&gt;The should be something like BACK/IGNO=EOF or /ALLOCATED&lt;BR /&gt;&lt;BR /&gt;In the mean time anyone needing a solution is left with the tedious DUMP and ANAL/SYST hacks Volker suggests, or would have to write a program to open the file with FIB$V_NOLOCK active and QIO copy the blocks to a work file. Maybe some rainy afternoon I'll code that up, but I'm afraid I do not have the time just now...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Jul 2006 06:30:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993764#M23308</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-07-28T06:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993765#M23309</link>
      <description>Wolker, many thanks,&lt;BR /&gt;&lt;BR /&gt;It runs perfectly, and it's not your fault, I can see it in the HELP too...&lt;BR /&gt;&lt;BR /&gt;Many thanks for yours replies and the time expent in it...&lt;BR /&gt;&lt;BR /&gt;Cheers,,&lt;BR /&gt;&lt;BR /&gt;Juan</description>
      <pubDate>Fri, 28 Jul 2006 06:31:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993765#M23309</guid>
      <dc:creator>Juan M. Lazaro</dc:creator>
      <dc:date>2006-07-28T06:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993766#M23310</link>
      <description>Just for grins... Here is an other way to 'see' the data.&lt;BR /&gt;This follows the file id into indexf.sys, to the header and then dump the data pointed to by the first mapping pointer.&lt;BR /&gt;I don't have my file system internals book handy, so for now it has the serious limitation of using a hardcoded 22 bit LBN retrieval pointer format. Yikes.&lt;BR /&gt;And it does just 1 pointer to begin with.&lt;BR /&gt;To be fixed if and when the procedure needs to be used for real.&lt;BR /&gt;For now it is just a 'look what I can do' excercise :-)&lt;BR /&gt;&lt;BR /&gt;$if p1.eqs."" then inquire p1 "file name"&lt;BR /&gt;$dir/file/out=tmp.tmp/notrail/nohead/wid=file=1 'p1&lt;BR /&gt;$open/read tmp tmp.tmp&lt;BR /&gt;$read tmp tmp&lt;BR /&gt;$read tmp tmp&lt;BR /&gt;$clos tmp&lt;BR /&gt;$dele tmp.tmp.&lt;BR /&gt;$id = f$elem(0,",",f$elem(1,"(",tmp))&lt;BR /&gt;$dev =  f$parse(p1,,,"device")&lt;BR /&gt;$ibmapsize = (f$getdvi(dev,"maxfiles") + 4095) / 4096&lt;BR /&gt;$indexf_bitmap_vbn = (f$getdvi(dev,"cluster") * 4) + 1&lt;BR /&gt;$header_vbn = indexf_bitmap_vbn + ibmapsize + id -1&lt;BR /&gt;$! dump/bloc=(start:'header_vbn',count=1) 'dev'[000000]indexf.sys&lt;BR /&gt;$vbn = "1234"&lt;BR /&gt;$vbn[0,32]='header_vbn&lt;BR /&gt;$open/read/share=write indexf 'dev'[000000]indexf.sys&lt;BR /&gt;$read/key=&amp;amp;vbn indexf header   ! Fails if vbn looks like quote :-(&lt;BR /&gt;$close indexf&lt;BR /&gt;$!show sym header&lt;BR /&gt;$name_offset = 2*f$cvui(0,8,header)&lt;BR /&gt;$map_offset = 8*2*f$cvui(8,8,header)&lt;BR /&gt;$name = f$extr(name_offset,20,header)&lt;BR /&gt;$lbn  = 256*256*f$cvui(8+map_offset,6,header) !Assume 22 bit pointer format&lt;BR /&gt;$lbn  = lbn + f$cvui(16+map_offset,16,header) !Swapped low bits&lt;BR /&gt;$! lbn_bits = f$cvui(map_offset,32,header)&lt;BR /&gt;$! show symb lbn_bits&lt;BR /&gt;$! write sys$output "id=''id', vbn=''header_vbn', name=''name', lbn=''lbn'"&lt;BR /&gt;$dump/block=(start='lbn',count='f$getdvi(dev,"cluster")') 'dev'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy!&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Jul 2006 08:00:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993766#M23310</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-07-28T08:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993767#M23311</link>
      <description>Hi Hein,&lt;BR /&gt;&lt;BR /&gt;Great work, maybe it was a rainy morning???&lt;BR /&gt;&lt;BR /&gt;Many thanks for your program, work and time...&lt;BR /&gt;&lt;BR /&gt;I've had a little problem, in the last line, the count only gives to me the disk cluster size, in my system is 3, and I've allocated 144 blocks, it can be solved if you replace the last line:&lt;BR /&gt;&lt;BR /&gt;dump/block=(start='lbn',count='f$getdvi(dev,"cluster")') 'dev'&lt;BR /&gt;&lt;BR /&gt;with&lt;BR /&gt;&lt;BR /&gt;dump/block=(start='lbn',count='f$file_attributes(p1,"alq")') 'dev'&lt;BR /&gt;&lt;BR /&gt;To display all the blocks allocated by the file.&lt;BR /&gt;&lt;BR /&gt;In any case your program runs ok, thanks again.&lt;BR /&gt;&lt;BR /&gt;Juan</description>
      <pubDate>Mon, 31 Jul 2006 05:05:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993767#M23311</guid>
      <dc:creator>Juan M. Lazaro</dc:creator>
      <dc:date>2006-07-31T05:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993768#M23312</link>
      <description>&lt;!--!*#--&gt;Well, it is always safe to dump at least one cluster. That's why I used that shortcut.&lt;BR /&gt;I since came across  a file systems internal book.&lt;BR /&gt;So here is an update which understands the 3 formats.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;$if p1.eqs."" then inquire p1 "file name"&lt;BR /&gt;$dir/file/out=tmp.tmp/notrail/nohead/wid=file=1 'p1&lt;BR /&gt;$open/read tmp tmp.tmp&lt;BR /&gt;$read tmp tmp&lt;BR /&gt;$read tmp tmp&lt;BR /&gt;$clos tmp&lt;BR /&gt;$dele tmp.tmp.&lt;BR /&gt;$id = f$elem(0,",",f$elem(1,"(",tmp))&lt;BR /&gt;$dev =  f$parse(p1,,,"device")&lt;BR /&gt;$ibmapsize = (f$getdvi(dev,"maxfiles") + 4095) / 4096&lt;BR /&gt;$indexf_bitmap_vbn = (f$getdvi(dev,"cluster") * 4) + 1&lt;BR /&gt;$header_vbn = indexf_bitmap_vbn + ibmapsize + id -1&lt;BR /&gt;$dump/bloc=(start:'header_vbn',count=1) 'dev'[000000]indexf.sys&lt;BR /&gt;$vbn = "1234"&lt;BR /&gt;$vbn[0,32]='header_vbn&lt;BR /&gt;$open/read/share=write indexf 'dev'[000000]indexf.sys&lt;BR /&gt;$read/key=&amp;amp;vbn indexf header   ! Fails if vbn looks like quote :-(&lt;BR /&gt;$close indexf&lt;BR /&gt;$!show sym header&lt;BR /&gt;$name_offset = 2*f$cvui(0,8,header)&lt;BR /&gt;$map_offset = 8*2*f$cvui(8,8,header)&lt;BR /&gt;$bits_in_use = 8*2*f$cvui(58*8,8,header)&lt;BR /&gt;$name = f$extr(name_offset,20,header)&lt;BR /&gt;$write sys$output "id=''id', vbn=''header_vbn', name=''name'"&lt;BR /&gt;$&lt;BR /&gt;$map_loop:&lt;BR /&gt;$fmt  = f$cvui(8+6+map_offset,2,header)&lt;BR /&gt;$!lbn_bits = f$cvui(map_offset,32,header)&lt;BR /&gt;$!show symb lbn_bits&lt;BR /&gt;$if fmt.eq.1&lt;BR /&gt;$then&lt;BR /&gt;$ bits = 32&lt;BR /&gt;$ size = 1 + f$cvui(map_offset,8,header)       !  8 bit size&lt;BR /&gt;$ lbn  = 256*256*f$cvui(8+map_offset,6,header) ! 22 bit map pointer&lt;BR /&gt;$ lbn  = lbn + f$cvui(16+map_offset,16,header) ! 22 bit map pointer&lt;BR /&gt;$endif&lt;BR /&gt;$if fmt.eq.2&lt;BR /&gt;$then&lt;BR /&gt;$ bits = 48&lt;BR /&gt;$ size = 1 + f$cvui(map_offset,14,header)      ! 14 bits size&lt;BR /&gt;$ lbn  = lbn + f$cvui(16+map_offset,32,header) ! 32 bit map pointer&lt;BR /&gt;$endif&lt;BR /&gt;$if fmt.eq.3&lt;BR /&gt;$then&lt;BR /&gt;$ bits = 64&lt;BR /&gt;$ size = 1 + 256*256*f$cvui(map_offset,14,header)  ! 14 MSB bits for size&lt;BR /&gt;$ size = size +f$cvui(16+map_offset,16,header)     ! 16 LSB bits for size&lt;BR /&gt;$ lbn  = lbn + f$cvui(32+map_offset,32,header) ! 32 bit map pointer&lt;BR /&gt;$endif&lt;BR /&gt;$&lt;BR /&gt;$write sys$output "use=''bits_in_use', fmt=''fmt' lbn=''lbn', size=''size'"&lt;BR /&gt;$! size=1&lt;BR /&gt;$dump/block=(star='lbn',coun='size') 'dev'&lt;BR /&gt;$map_offset = map_offset + bits&lt;BR /&gt;$bits_in_use = bits_in_use - bits&lt;BR /&gt;$if bits_in_use .ge.32 then goto map_loop&lt;BR /&gt;$exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Jul 2006 07:07:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993768#M23312</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-07-31T07:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993769#M23313</link>
      <description>Hein,&lt;BR /&gt;  parhaps you can add some comments and submit it at dcl.openvms.org&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Jul 2006 08:19:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993769#M23313</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2006-07-31T08:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993770#M23314</link>
      <description>&lt;!--!*#--&gt;Ian,  Sure, I'll try. It should prove an interesting example of the odd things you can do with DCL.&lt;BR /&gt;&lt;BR /&gt;However, I think the solution below is more useful.&lt;BR /&gt;&lt;BR /&gt;Juan, I suggested one could write a program with ACP QIO and NOLOCK. However, I realize that while it is no rocket science, it is a little tricky. So I cobbled up something that seems to do the trick. Minimally tested, but probably good enough.&lt;BR /&gt;&lt;BR /&gt;Program attached, and included below.&lt;BR /&gt;Enjoy!&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt;** read_locked.c  Hein van den Heuvel, July 2006&lt;BR /&gt;**&lt;BR /&gt;** This program can be used to copy the allocated blocks from a locked file&lt;BR /&gt;** Much like BACKUP/IGNORE=INTERLOCK is use the ACP NOLOCK access to over-&lt;BR /&gt;** ride file interlock. This requires SYSPRV or CONTROL ACCESS to the file.&lt;BR /&gt;** Unlike BACKUP this program simply reads all ALLCOATED blocks as the&lt;BR /&gt;** EOF information is likely not to be updated by the active writer (zero).&lt;BR /&gt;** The program copies MOST file attributes, but not all as its intended&lt;BR /&gt;** use is limited to copy live log files and such.&lt;BR /&gt;**&lt;BR /&gt;** You may need to use SET FILE/ATTR=(EBK:x,FFB:y) on the output as needed.&lt;BR /&gt;**&lt;BR /&gt;** If the code format looks a little odd and dated... it is!&lt;BR /&gt;** This program is loosly basde on some old example which where floating&lt;BR /&gt;** around at Digital Equipment such as SET_EXTENT.&lt;BR /&gt;** Suspected authors: Barry Dysert, Guenther Froehlin, me?...&lt;BR /&gt;**&lt;BR /&gt;** Enjoy!&lt;BR /&gt;** Hein, HvdH Perfromance Consulting&lt;BR /&gt;**&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;#define MAXBLOCKS 120&lt;BR /&gt;#define MAXBYTES MAXBLOCKS*512&lt;BR /&gt;&lt;BR /&gt;#include atrdef&lt;BR /&gt;/*&lt;BR /&gt;**  libr/extr=fatdef/out=fatdef.h sys$library:sys$lib_c.tlb&lt;BR /&gt;*/&lt;BR /&gt;#include "fatdef.h"&lt;BR /&gt;#include fibdef&lt;BR /&gt;#include iodef&lt;BR /&gt;#include rms&lt;BR /&gt;#include stdio&lt;BR /&gt;#include stdlib&lt;BR /&gt;#include string&lt;BR /&gt;&lt;BR /&gt;int sys$create(), sys$connect(), sys$write(), sys$close();&lt;BR /&gt;int sys$create(), sys$parse(), sys$search();&lt;BR /&gt;int sys$assign(), SYS$QIOW(), lib$stop();&lt;BR /&gt;&lt;BR /&gt;main(argc,argv)&lt;BR /&gt;int argc;&lt;BR /&gt;char *argv[];&lt;BR /&gt;    {&lt;BR /&gt;    static char buf[MAXBYTES];&lt;BR /&gt;    static char *usage = "Usage: $ read_locked name output_name\n";&lt;BR /&gt;    static char esa[256], rsa[256];&lt;BR /&gt;    static int status, channel, bytes, vbn=1;&lt;BR /&gt;    static int file_hbk, file_nbytes, spec_nbytes;&lt;BR /&gt;    static struct FAB fab, out;&lt;BR /&gt;    static struct RAB rab;&lt;BR /&gt;    static struct NAM nam;&lt;BR /&gt;    static struct&lt;BR /&gt;        {&lt;BR /&gt;        short status;&lt;BR /&gt;        char not_used[6];&lt;BR /&gt;        } iosb;&lt;BR /&gt;    static struct&lt;BR /&gt;        {&lt;BR /&gt;        short count;&lt;BR /&gt;        short not_used;&lt;BR /&gt;        void *address;&lt;BR /&gt;        } fibdes;&lt;BR /&gt;    static struct fibdef fib;&lt;BR /&gt;    static struct atrdef atr[2];&lt;BR /&gt;FAT attributes;&lt;BR /&gt;    struct { int len; char *addr; } devnam_desc;&lt;BR /&gt;&lt;BR /&gt;/******************************************************************************/&lt;BR /&gt;&lt;BR /&gt;/*  Verify that we've been properly invoked */&lt;BR /&gt;&lt;BR /&gt;    if (argc != 3) printf("%s",usage), exit(1);&lt;BR /&gt;&lt;BR /&gt;/*  Use RMS to parse the file so that we get a FID of the QIO */&lt;BR /&gt;&lt;BR /&gt;    fab = cc$rms_fab;&lt;BR /&gt;    fab.fab$l_fna = argv[1];&lt;BR /&gt;    fab.fab$b_fns = strlen (argv[1]);&lt;BR /&gt;    fab.fab$l_nam = &amp;amp;nam;&lt;BR /&gt;&lt;BR /&gt;    nam = cc$rms_nam;&lt;BR /&gt;    nam.nam$l_esa = esa;&lt;BR /&gt;    nam.nam$b_ess = sizeof (esa) - 1;&lt;BR /&gt;    nam.nam$l_rsa = rsa;&lt;BR /&gt;    nam.nam$b_rss = sizeof (rsa) - 1;&lt;BR /&gt;&lt;BR /&gt;    out = cc$rms_fab;&lt;BR /&gt;    out.fab$b_fac = FAB$M_BIO | FAB$M_PUT;&lt;BR /&gt;    out.fab$l_fna = argv[2];&lt;BR /&gt;    out.fab$b_fns = strlen (argv[2]);&lt;BR /&gt;&lt;BR /&gt;    rab = cc$rms_rab;&lt;BR /&gt;    rab.rab$l_fab = &amp;amp;out;&lt;BR /&gt;    rab.rab$l_rbf = buf;&lt;BR /&gt;    rab.rab$w_rsz = sizeof(buf);&lt;BR /&gt;&lt;BR /&gt;    if (((status=sys$parse(&amp;amp;fab)) &amp;amp; 1) != 1) lib$stop(status);&lt;BR /&gt;    if (((status=sys$search(&amp;amp;fab)) &amp;amp; 1) != 1) lib$stop(status);&lt;BR /&gt;&lt;BR /&gt;/* Get a channel for QIO access */&lt;BR /&gt;&lt;BR /&gt;    devnam_desc.addr = nam.nam$l_dev;&lt;BR /&gt;    devnam_desc.len  = nam.nam$b_dev;&lt;BR /&gt;    if (((status=sys$assign(&amp;amp;devnam_desc,&amp;amp;channel,0,0,0)) &amp;amp; 1) != 1) lib$stop(status);&lt;BR /&gt;&lt;BR /&gt;/*  Set up the structures required for the ACP interface */&lt;BR /&gt;&lt;BR /&gt;    fibdes.count = sizeof(fib);&lt;BR /&gt;    fibdes.address = &amp;amp;fib;&lt;BR /&gt;&lt;BR /&gt;    fib.fib$l_acctl    = FIB$M_NOLOCK;&lt;BR /&gt;    fib.fib$w_fid_num  = nam.nam$w_fid[0];&lt;BR /&gt;    fib.fib$w_fid_seq  = nam.nam$w_fid[1];&lt;BR /&gt;    fib.fib$w_fid_rvn  = nam.nam$w_fid[2];&lt;BR /&gt;&lt;BR /&gt;    atr[0].atr$w_type  = ATR$C_RECATTR;&lt;BR /&gt;    atr[0].atr$w_size  = ATR$S_RECATTR;&lt;BR /&gt;    atr[0].atr$l_addr  = &amp;amp;attributes;&lt;BR /&gt;    atr[1].atr$w_type  = 0;&lt;BR /&gt;    atr[1].atr$w_size  = 0;&lt;BR /&gt;&lt;BR /&gt;/*  Get the file's current attributes, such as hi-block, rfm,... */&lt;BR /&gt;&lt;BR /&gt;    status = SYS$QIOW(0,channel,IO$_ACCESS|IO$M_ACCESS,&amp;amp;iosb,0,0,&amp;amp;fibdes,0,0,0,&amp;amp;atr,0);&lt;BR /&gt;    if ((status &amp;amp; 1) != 1) lib$stop(status);&lt;BR /&gt;    if ((iosb.status &amp;amp; 1) != 1) lib$stop(iosb.status);&lt;BR /&gt;&lt;BR /&gt;/*  Validate the specified values (e.g. can't extend the file) */&lt;BR /&gt;&lt;BR /&gt;    file_hbk = attributes.fat$w_hiblkl + (attributes.fat$w_hiblkh &amp;lt;&amp;lt; 16);&lt;BR /&gt;    file_nbytes = file_hbk*512;&lt;BR /&gt;&lt;BR /&gt;    out.fab$l_alq = file_hbk;&lt;BR /&gt;    out.fab$b_rat = attributes.fat$b_rattrib;&lt;BR /&gt;    out.fab$b_rfm = attributes.fat$b_rtype;&lt;BR /&gt;    out.fab$w_mrs = attributes.fat$w_maxrec;  /* LRL=fat$w_rsize ?? */&lt;BR /&gt;    out.fab$b_fsz = attributes.fat$b_vfcsize;&lt;BR /&gt;    status = sys$create ( &amp;amp;out ) ;&lt;BR /&gt;    if (status &amp;amp; 1) status = sys$connect ( &amp;amp;rab );&lt;BR /&gt;    while ((status &amp;amp; 1) &amp;amp;&amp;amp; (file_nbytes &amp;gt; 0)) {&lt;BR /&gt;&lt;BR /&gt;        if (file_nbytes &amp;gt;= MAXBYTES) {&lt;BR /&gt;                bytes = MAXBYTES;&lt;BR /&gt;                file_nbytes -= MAXBYTES;&lt;BR /&gt;        } else {&lt;BR /&gt;                bytes = file_nbytes;&lt;BR /&gt;                rab.rab$w_rsz = file_nbytes;&lt;BR /&gt;                file_nbytes = 0;&lt;BR /&gt;        }&lt;BR /&gt;&lt;BR /&gt;        status = SYS$QIOW(0,channel,IO$_READVBLK,&amp;amp;iosb,0,0,&amp;amp;buf,bytes,vbn,0,0,0,0);&lt;BR /&gt;        vbn += MAXBLOCKS;&lt;BR /&gt;        if (status &amp;amp; 1) status = iosb.status;&lt;BR /&gt;        if (status &amp;amp; 1) status = sys$write ( &amp;amp;rab );&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;/*  Release the files */&lt;BR /&gt;&lt;BR /&gt;    (void) SYS$QIOW(0,channel,IO$_DEACCESS,&amp;amp;iosb,0,0,&amp;amp;fibdes,0,0,0,0,0);&lt;BR /&gt;    (void) sys$close ( &amp;amp;out );&lt;BR /&gt;    return status;&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Jul 2006 22:59:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993770#M23314</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-07-31T22:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Read a locked file...</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993771#M23315</link>
      <description>Hein, many thanks again, the last dcl you posted runs perfectly, the c program I don't know, I haven't any possibility now to compile it, but when I can I try to test it.&lt;BR /&gt;&lt;BR /&gt;And I agree with Ian, you should post the dcl in dcl.openvms.org.&lt;BR /&gt;&lt;BR /&gt;Thanks again to all the replies.&lt;BR /&gt;&lt;BR /&gt;Juan</description>
      <pubDate>Tue, 01 Aug 2006 01:17:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/read-a-locked-file/m-p/4993771#M23315</guid>
      <dc:creator>Juan M. Lazaro</dc:creator>
      <dc:date>2006-08-01T01:17:07Z</dc:date>
    </item>
  </channel>
</rss>

