Python code: Connect the 8G BS bitmap of IBM V7000 based on the relationship between bitmaps

Source: Internet
Author: User

Import sqlite3import structcx_m = sqlite3.connect ("f:\\zy\\map\\map_v2.db") cu_m =  cx_m.cursor () bs = 256 * 1024 * 1024bs = 256 *  1024sdisk = []sdisk.append ("") Sdisk.append ("") Sdisk.append ("") Sdisk.append ("") Sdisk.append (["H:\ Mdisk4.img ",  0]) sdisk.append ([" g:\mdisk5.img ",  0]) sdisk.append ([" i:\mdisk6.img ",  0]) Sdisk.append (["d:\mdisk7.img",  0]) sdisk.append (["e:\mdisk8.img",  0]) sdisk.append (["F:\mdisk9.img",  0]) For disk in sdisk[4:10]:    disk[1] = open (Disk[0],   ' RB ') Tlist = list () curno,curdid,curbs =0,4,800tlist.append ([Curno,curdid,curbs]) pEnd  = 0while true:    pos = curbs * bs + 512  * 1024    f = sdisk[curdid][1]    f.seek (POS)     d = f.read (BS) &NBSP;&NBSp;  v = struct.unpack_from ("Q", d,bs -8 - pend * 8) [0]     if v == 0:        break     if curBS == 13333 or curBS == 21088 :         vj = 160    elif curbs == 22588  or  (curbs == 3861 and curdid == 7):         vj = 1600    elif curBS == 26044:         v = 39160914945    elif curbs ==  6834 and curDid == 8:        v =  55357308929    elif curbs == 6866 and curdid == 8:         v = 55407631873    elif curbs == 10472 and  curdid == 9:        v = 54081059329     else:        vj = 16    v1  = v-vj*512    v2 = v+vj*512     #print ("V1,v2:", v1 , v2)     cu_m.execute (r "select * from map_info where v_num  > %d and v_num < %d and map_item_pos < 5 "% (V1,V2))      rows = cu_m.fetchall ()     isbreak = False     if len (rows)  == 0:        if  pend < 7:            pend +=  1            continue;        else:             print ("Len is 0:CurDid,CurBS  is break ",  curdid, curbs)               #print (tlist)             pend =  0            break;     Elif len (rows)  > 1:        t1,t2 = rows[0] [0],rows[0][1]         #print ("T1,t2 is", T1,t2)          for row1 in rows:             if t1 != row1[0] or t2 != row1[1]:                  print ("Len >1,t1,t2,row[0],row[1] is ", T1,t2,row1[0],row1[1])                  isbreak = True                 break;    if isbreak:         print ("Curdid,curbs is break",  curdid, curbs) #         print (tlist)         break;     else:        pend = 0    curno +=  1    curdid = rows[0][0]    curbs = rows[0][ 1]     #if  curdid== 9 and curbs== 7471:    #     brEak    tlist.append ([Curno,curdid,curbs])    # if curbs ==  18511 and curdid == 8:    #    breakprint (" The list num is ", Len (tlist)) print (tlist) f1 = open (" F:\\zy\\8glist.txt ", ' w+ ') for  I in tlist:    f1.write ("%d\t%d\t%d\n"% (i[0],i[1],i[2]))


Python code: Connect the 8G BS bitmap of IBM V7000 based on the relationship between bitmaps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.