Rocket U2 | UniVerse & UniData

 View Only
Expand all | Collapse all

32-bit vs 64-bit files - Identify and update

  • 1.  32-bit vs 64-bit files - Identify and update

    Posted 01-04-2021 13:55
    We have converted a number of our files from 32-bit to 64-bit over that last couple of years. Typically, that has been done when we have a write issue and react to the specific problem. Does anyone have a dictionary or programmatic means of identifying the two type of file so that we can target conversion proactively?

    Once the files are identified, they can certainly be resized to 64-bit via a script.

    ------------------------------
    Jeff Teter
    Woodforest National Bank
    ------------------------------


  • 2.  RE: 32-bit vs 64-bit files - Identify and update

    ROCKETEER
    Posted 01-04-2021 14:05
    Jeff,

    Code 31 for the FILEINFO Basic function would tell you if the file is 32 or 64 bit.

    ------------------------------
    Michael Rajkowski
    Rocket Software
    ------------------------------



  • 3.  RE: 32-bit vs 64-bit files - Identify and update

    PARTNER
    Posted 01-04-2021 14:26

    Hi Mike,

    Perhaps INCLUDE/FILEINFO.H should be updated to include the new values. Would you like me to open a support case?


    Henry



    ------------------------------
    Henry Unger
    President
    Pulsiam
    Encino CA
    3106918107
    ------------------------------



  • 4.  RE: 32-bit vs 64-bit files - Identify and update

    PARTNER
    Posted 01-04-2021 14:30
    If you want to see which files are 64-bit files you can write a script that uses the uvfileinfo command, e.g.:

    $ uvfileinfo VOC
    VOC little-endian 64bit

    $ uvfileinfo TEMPFILE
    TEMPFILE little-endian 32bit

    ------------------------------
    Henry Unger
    President
    Pulsiam
    Encino CA
    3106918107
    ------------------------------



  • 5.  RE: 32-bit vs 64-bit files - Identify and update

    ROCKETEER
    Posted 01-04-2021 14:38
    Henry,

    Actually, No, the 31 is for UniData, not UniVerse.


    Jeff,

    Which Rocket MultiValue Database are you using?




    ------------------------------
    Michael Rajkowski
    Rocket Software
    ------------------------------



  • 6.  RE: 32-bit vs 64-bit files - Identify and update

    ROCKETEER
    Posted 01-07-2021 19:47
    All,

    I took the time to review the FILEINFO for both UniData and UniVerse.  While several code are the same some do different things, and other are in one or the other.  While I do not expect it is possible to force either side to change, I am providing the list for reference.  I will also be discussing possibly adding a 32/64Bit code to UniVerse.

    Code

    UniVerse Notes

    UNIVERSE.INCLUDE

    UniData Notes

    0

    1 if file.variable

    is a valid file variable; 0 otherw

    FINFO$IS.FILEVAR

    File open status

    1= Open

    0= Not open

    1

    VOC name of the file

    FINFO$VOCNA

    This parameter is not

    implemented.

    2

    Path name of the file On Windows, a file that is local to the account will

    be delimited with a forward slash

    FINFO$PATHNA

    Path name of file

    3

    File type as follows:

    1 Static hashed

    3 Dynamic hashed

    4 Type 1

    5 Sequential

    7 Distributed and Multivolu

     

    FINFO$TYP

    File Type

    HASHED      2

    DYNAMIC     3

    DIRECTORY   4

    SEQUENTIAL  5

    NFA         7

    OS          8

    EDA        13

    4

    Hashing algorithm: 2 for GENERAL, 3 for NUM

    FINFO$HASHALG

    Hash Type

    HASH & DYNAMIC(KEYONLY) Hash type (0, 1, or 3)

    DYNAMIC (KEYDATA) Hash type (32 , 33, or 35)

    DYNAMIC (WHOLEFILE) Hash type (48, 49, or 51)

    5

    Current modulus.

    FINFO$MODULUS

    Hash             Modulo

    Directory        0

    Dynamic          Current modulo

    Other            Not applicable

     

    6

    Minimum modulus

    FINFO$MINMODULUS

    Dynamic – Min Modulus

    7

    Group size, in 1-KB units.

    FINFO$GROUPSIZE

     

    Hash/Dynamic (Block size/1024)-1

    Other     Not applicable

     

    8

    Large record size.

    FINFO$LARGERECORDSIZE

     

     

    8

     

     

     

    Hash & Dynamic      Blocksize

    Others                       Not applicable

    9

    Merge load parameter.

    FINFO$MERGELOAD

     

    Merge factor percentage

    10

    Split load parameter.

    FINFO$SPLITLOAD

     

    Split factor percentage

    11

    Current loading of the file (%).

    FINFO$CURRENTLOAD

     

    Current load percentage

    Percent result of the

    formula:

    (keyspace(grp)*100)/blksize

     

    12

    Empty string, if the file resides on the local system,

    otherwise the name of the node where the file resides

     

    FINFO$NODENAME

     

    Node name

    This parameter is not

    implemented.

     

    13

    1 if secondary indexes exist on the file; 0 otherwise

    FINFO$IS.AKFILE

     

    Does file contain alternate key

    indexes?

    1= yes; 2 = no

    14

    Current line number.

    FINFO$CURRENTLINE

     

    Next line number to read or write

    Sequential Files: Next line number

    15

    For a distributed file, returns list of currently open part

    numbers.

    FINFO$PARTNUM

     

    Part number

     

    This parameter is not

    implemented.

     

    16

    For a distributed file, returns list of status codes showing

    whether the last I/O operation succeeded or failed for

    each part. A value of –1 indicates the corresponding part

    file is not open.

     

    FINFO$STATUS

     

    This parameter is not

    implemented.

     

    17

    Returns 1 for all recoverable file types: static, dynamic, B-

    tree, and distributed files. Returns 0 for non-recoverable

    file types: DIR and sequential files.

     

    FINFO$RECOVERYTYPE

     

     

    17

     

     

    Filename

    HASH & DIR & DYNAMIC - VOC entry name

    18

    Always returns an empty string

    FINFO$RECOVERYID

     

     

    18

     

     

    Block size of file  (Returns the same value as

    option 8)

    19

    Always returns 0

    FINFO$IS.FIXED.MODULUS

     

     

    19

     

     

    Access permissions

    Permissions the person

    running the program has

    expressed as total

    UNIX

    values

    (r=4,w=2,x=1, so rw= 6)

    20

    If NLS is enabled, the file map name, otherwise an empty

    string. If the map name is the default specified in the

    uvconfig

    file, the returned string is the map name

    followed by the name of the configurable parameter in

    parentheses.

     

    FINFO$NLSMAP

     

     

    20

     

     

    Index to which the last SETINDEX

    statement was applied (VOC entry name )

     

    21

    ( Note documented )

    FINFO$MAXKEYSIZE

     

     

    21

     

     

    Index record read by last

    browsing statement, such as

    READFWD and READBCK.

    (Key value)

    22

    Returns a dynamic array containing the following

    information:

    For a file encrypted with the WHOLERECORD option:

    -1@VM<key_id>@VM<algorithm>

    For a file encrypted at the field level:

    <location>@VM<key_id>@VM

    <algorithm>@VM<field_name>[@FM

    <location>...@VM<field_name>]

    Returns an empty string if the file is not encrypted

     

    FINFO$ENCINFO

     

     

    22

     

     

    File type: recoverable or

    Nonrecoverable

    1 – Recoverable

    0 – Nonrecoverable

     

    23

    Returns a dynamic array containing the following

    information:

    For an encrypted index field:

    <location>@VM<key_id>@VM<algorithm>

    @VM<field_name>[@FM<location>...@VM<field_name>]

    Note that multiple encrypted index fields are

    separated by

    @FM

    .

    Returns an empty string if the field is not encrypted

    or CREATE.INDEX

    <file> <field>

    has not been

    issued.

     

    FINFO$IDXENCINFO

     

     

    23

     

     

    Numeric key

    For sequentially hashed

    files.

    1 – Numeric keys

    0 – Non-numeric keys

    24

    Return values can be:

    0 – The file is not published, subscribed, or subwriteable.

    1 – The file is being published.

    2 – The file is being subscribed.

    3 – The file is subwriteable.

    Note

    :

    If

    Data Replication

    is not running, 0 is returned for

    any file used with this function.

    FINFO$REPSTATUS

     

    Type of U2 Data Replication file

    0 - The file is not a replication    object

    1 – The file is being published

    2 – The file is being subscribed

    3 - The file is subwriteable

     

    24

    Return values can be:

    0 - The dynamic file contains no records.

    1 - The dynamic file contains records

     

    FINFO$MAXOPTION

     

     

    25

     

     

    BEFORE-UPDATE-TRIGGER catalog program name of the file <xx>.

    BEFORE-UPDATE-TRIGGER

    catalog program name of

    the file. If no such trigger

    exists, returns and empty

    string.

     

    26

     

     

    BEFORE-DELETE-TRIGGER catalog program name of the file <xx>.

    BEFORE-DELETE-TRIGGER

    catalog program name of

    the file. If no such trigger

    exists, returns and empty

    string.

    27

     

     

    Is the file encrypted?

    0 – File is not encrypted

    1 – File is encrypted

    28

     

     

    Type of file encryption

    Returns a dynamic array

    containing the following

    information:

    For a file encrypted with

    the WHOLERECORD option:

    -1@SM<key-

    id>@SM<algorithm>

    For a file encrypted at the

    field level:

    <location>@SM<key-

    id>@SM<algorithm>

    @SM<field_name>

    Returns an empty string if

    the file is not encrypted.

     

    29

     

     

    AFTER-UPDATE-TRIGGER catalog

    program name of the file <xx>.

    AFTER-UPDATE-TRIGGER

    catalog program name of

    the file. If no such trigger

    exists, returns an empty

    string.

     

    30

     

     

    AFTER-DELETE-TRIGGER catalog

    program name of the file <xx>.

    AFTER-DELETE-TRIGGER

    catalog program name of

    the file. If no such trigger

    exists, returns an empty

    string.

     

    31

     

     

    Defines the bit type

    0 – 32–bit file

    1 – 64–bit fil

     

    99

    Special key to retrieve hdr layout

    FINFO$HDRLAYOUT

     

     



    ------------------------------
    Michael Rajkowski
    Rocket Software
    ------------------------------



  • 7.  RE: 32-bit vs 64-bit files - Identify and update

    PARTNER
    Posted 01-08-2021 02:05
    Hi
    IMHO, no need for a change on uv, the info is available with the STATUS/FROM filevar.

    ------------------------------
    Manu Fernandes
    ------------------------------



  • 8.  RE: 32-bit vs 64-bit files - Identify and update

    ROCKETEER
    Posted 01-04-2021 14:39
    Mike,
    Is the code 31 for FILEINFO something available in UniData?
    I don't think such a code currently exists in UniVerse.
    Thanks,
    Neil

    ------------------------------
    Neil Morris
    Rocket Software
    ------------------------------



  • 9.  RE: 32-bit vs 64-bit files - Identify and update

    ROCKETEER
    Posted 01-04-2021 14:46
    ALL,

    The code 31 is for UniData, and here is a quick example.

    001  EXECUTE "CREATE.FILE MR32 3 3 32BIT"
    002: OPEN "MR32" TO MR32 ELSE STOP "NG1"
    003  PRINT "MR32 - ":FILEINFO(MR32,31)
    004: EXECUTE "CREATE.FILE MR64 3 3 64BIT"
    005: OPEN "MR64" TO MR64 ELSE STOP "NG1"
    006: PRINT "MR64 - ":FILEINFO(MR64,31)
    Bottom.
    *--: FIBR
    Filed "MIKE" in file "BP".

    Compiling Unibasic: BP\MIKE in mode 'u'.
    compilation finished
    Create file D_MR32, modulo/3,blocksize/1024
    Hash type = 0
    Create file MR32, modulo/3,blocksize/1024
    Hash type = 3
    Added "@ID", the default record for UniData to DICT MR32.
    MR32 - 0
    Create file D_MR64, modulo/3,blocksize/1024
    Hash type = 0
    Create file MR64, modulo/3,blocksize/1024
    Hash type = 3
    Added "@ID", the default record for UniData to DICT MR64.
    MR64 - 1

    Note that I ran my test on UniData 8.2.2

    ------------------------------
    Michael Rajkowski
    Rocket Software
    ------------------------------



  • 10.  RE: 32-bit vs 64-bit files - Identify and update

    Posted 01-04-2021 16:44

    If on UniVerse, other options that indicate whether 32bit or 64bit that I can think of...

     ANALYZE.FILE from > prompt.

    >ANALYZE.FILE VOC
    File name = VOC
    File type = 17
    File style and revision = 32BIT Revision 12

    filepeek filename (requires admin access)

    $filpeek VOC
    filepeek status:
    Active file .......... "VOC"
    Current file address . 0x00000000
    Maximum file address . 0x00027FFF
    Window size .......... 512 bytes
    0xFF will display as . "ÿ"
    Default base ......... 16
    Default mode ......... 32-bit
    File type ............ 17

    Raw Header
    Or you can read the header raw to inspect the "magic" number.  Please note that byte order comes to play when you start looking at the raw data.  So your system may not look exactly like this due to little/big endian changes.

      The "01" below indicates 32bit, if it was 02, it would be 64bit.

    $od -x HELP.FILE | head -1
    0000000 acef 010c 0000 0011 0000 0000 0000 0293

    You can use READBLK from inside a UniVerse program to to inspect the header as well.  The following piece of code should work for both big and little endian machines.

    OPENSEQ '/u1/uv/HELP.FILE' TO SEQ.FILE ELSE STOP 'unable to open file.'
    READBLK MAGIC FROM SEQ.FILE,4 ELSE NULL
    CLOSESEQ SEQ.FILE
    MAGIC = OCONV(MAGIC,'MX0C')
    CRT MAGIC
    BEGIN CASE
       CASE MAGIC[1,4] = 'ACEF' ; * (ACEF010C)
          IF MAGIC[5,2] = '01' THEN BIT.TYPE = '32'
          IF MAGIC[5,2] = '02' THEN BIT.TYPE = '64'
       CASE MAGIC[5,4] = 'EFAC' ; * (0C01EFAC)
          IF MAGIC[3,2] = '01' THEN BIT.TYPE = '32'
          IF MAGIC[3,2] = '02' THEN BIT.TYPE = '64'
       CASE 1
         STOP 'not a UV file.'
    END CASE
    CRT 'bit.type = [':BIT.TYPE:']'
    END
    





    ------------------------------
    Ryan Ladd
    ------------------------------



  • 11.  RE: 32-bit vs 64-bit files - Identify and update

    PARTNER
    Posted 01-05-2021 10:51
    hello, 
    you can do it from basic with STATUS/FROM attribute <31> is the magic code of the file:
    31 File revision stamp One of the following:
      ACEF01xx = 32-bit file
      ACEF02xx = 64-bit file
    xx is the file revision level​


    ------------------------------
    Manu Fernandes
    ------------------------------



  • 12.  RE: 32-bit vs 64-bit files - Identify and update

    PARTNER
    Posted 01-11-2021 10:13
    here is the sample 
    * UV Get Magic Number for 32 or 64 Bit
    *
    GET (ARG.) FILENAME ELSE PROMPT "" ; CRT "Pathname: " :; INPUT FILENAME
    IF FILENAME = "" THEN STOP
    OPEN FILENAME TO FILEVAR ELSE CRT "Error " : STATUS() : " Opening >" : FILENAME : "<"
    STATUS FILESTATS FROM FILEVAR ELSE STOP "Basic STATUS failed on file >":FILENAME : "<"
    MAGIC = FILESTATS<31>
    CRT "MAGIC = " : MAGIC
    BEGIN CASE
      CASE MAGIC[5,2] = "01" ; CRT "32 Bit File"
      CASE MAGIC[5,2] = "02" ; CRT "64 Bit File"
      CASE 1                 ; CRT "Cannot Determine 32 or 64 Bit >":FILENAME : "<"
    END CASE
    
    END
    ​

    Sample at runtime


    RESIZE FTEST2 * * * 32BIT                 
    RUN INBASIC.UV UV_32OR64BIT FTEST2        
    MAGIC = ACEF010C                             
    32 Bit File                                  
    
    RESIZE FTEST2 * * * 64BIT                 
    RUN INBASIC.UV UV_32OR64BIT FTEST2        
    MAGIC = ACEF020C                             
    64 Bit File                                  
    ​


    ------------------------------
    Manu Fernandes
    ------------------------------