Skip to main content
Héctor Cortiguera
Participating Frequently
May 26, 2025 5:35 AM UTC

Creating subfolders in PYPROGS

Hi all

I'm creating a lot of tools using Python and version control is getting quite out of... control.

So I'm starting to create a folder infrastructure inside PYPROGS to manage the different tools and keep their basecodes separated.

My problem/question is:

How can I manage the subfolders in PYPROGS?

For example, I have some files organised like this:

-U2DBLiveDMS
    |-u2dblive.py
    |-u2dblive_common.py
-aws_boto3_context_manager.py
-aws_file_delete.py
-excel_utils.py

I can check my files using uopy:

            with uopy.connect(**config):
                cmd = uopy.Command("SELECT PYPROGS")
                cmd.run()
                select_list = uopy.List() 
                self.__lista_ficheros = select_list.read_list()
                rgx_cksum = re.compile(r'[Cc]ksum\\s+=\\s+([0-9]+)\\s+')
                for f in self.__lista_ficheros:
                    if f.endswith('.py'):
                        chk = uopy.Command(f'CHECK.SUM PYPROGS {f}')
                        chk.run()
                        m = rgx_cksum.search(chk.response)
                        if m:
                            self.__checksums.append(int(m.group(1)))
                    else:

cmd_chk = uopy.Command('CHECK.SUM PYPROGS excel_utils.py')
cmd_chk.run()
cmd_chk.response
'\\r\\nByte statistics for PYPROGS:\\r\\nTotal = 8345 Average = 8345 Items = 1 Cksum = -1403193208 Bits = 28293\\r\\n'

But I can't do this with the files inside U2DBLiveDMS

Is there a way to handle this?



------------------------------
Héctor Cortiguera
Quiter Servicios Informaticos SL
------------------------------

    7 replies

    Héctor Cortiguera
    Participating Frequently
    May 29, 2025 9:36 AM UTC

    Hi all

    I'm creating a lot of tools using Python and version control is getting quite out of... control.

    So I'm starting to create a folder infrastructure inside PYPROGS to manage the different tools and keep their basecodes separated.

    My problem/question is:

    How can I manage the subfolders in PYPROGS?

    For example, I have some files organised like this:

    -U2DBLiveDMS
        |-u2dblive.py
        |-u2dblive_common.py
    -aws_boto3_context_manager.py
    -aws_file_delete.py
    -excel_utils.py

    I can check my files using uopy:

                with uopy.connect(**config):
                    cmd = uopy.Command("SELECT PYPROGS")
                    cmd.run()
                    select_list = uopy.List() 
                    self.__lista_ficheros = select_list.read_list()
                    rgx_cksum = re.compile(r'[Cc]ksum\\s+=\\s+([0-9]+)\\s+')
                    for f in self.__lista_ficheros:
                        if f.endswith('.py'):
                            chk = uopy.Command(f'CHECK.SUM PYPROGS {f}')
                            chk.run()
                            m = rgx_cksum.search(chk.response)
                            if m:
                                self.__checksums.append(int(m.group(1)))
                        else:

    cmd_chk = uopy.Command('CHECK.SUM PYPROGS excel_utils.py')
    cmd_chk.run()
    cmd_chk.response
    '\\r\\nByte statistics for PYPROGS:\\r\\nTotal = 8345 Average = 8345 Items = 1 Cksum = -1403193208 Bits = 28293\\r\\n'
    

    But I can't do this with the files inside U2DBLiveDMS

    Is there a way to handle this?



    ------------------------------
    Héctor Cortiguera
    Quiter Servicios Informaticos SL
    ------------------------------

    Anyone?



    ------------------------------
    Héctor Cortiguera
    Quiter Servicios Informaticos SL
    ------------------------------
    Mike Rajkowski
    Rocketeer
    May 29, 2025 11:19 AM UTC

    Anyone?



    ------------------------------
    Héctor Cortiguera
    Quiter Servicios Informaticos SL
    ------------------------------

    Hector,

    I prefer/recommend having two systems for test and live, so I did not look at this that much the first time, and expected someone else may be doing this and would make recommendations.  

    If I am reading your code correctly, your issue is with nested directories.

    Did you create U2DBLiveDMS from the UniVerse Command line

    i.e.

    >CREATE.FILE PYPROGS,U2DBLiveDMS 19
    Creating a multilevel data file.
    Creating file "PYPROGS/U2DBLiveDMS" as Type 19.
    Creating file "D_PYPROGS" as Type 3, Modulo 1, Separation 2.
    Added "@ID", the default record for RetrieVe, to "D_PYPROGS".

    How did you change the code to use the PYPROGS,U2DBLiveDMS file?

    i.e.

    cmd_chk = uopy.Command('CHECK.SUM PYPROGS,U2DBLiveDMS excel_utils.py')

    Note another option to pull from the other directory, is to create a VOC entry that goes directly to that directory.



    ------------------------------
    Mike Rajkowski
    MultiValue Product Evangelist
    Rocket Internal - All Brands
    US
    ------------------------------

    Héctor Cortiguera
    Participating Frequently
    May 30, 2025 2:18 AM UTC

    Hector,

    I prefer/recommend having two systems for test and live, so I did not look at this that much the first time, and expected someone else may be doing this and would make recommendations.  

    If I am reading your code correctly, your issue is with nested directories.

    Did you create U2DBLiveDMS from the UniVerse Command line

    i.e.

    >CREATE.FILE PYPROGS,U2DBLiveDMS 19
    Creating a multilevel data file.
    Creating file "PYPROGS/U2DBLiveDMS" as Type 19.
    Creating file "D_PYPROGS" as Type 3, Modulo 1, Separation 2.
    Added "@ID", the default record for RetrieVe, to "D_PYPROGS".

    How did you change the code to use the PYPROGS,U2DBLiveDMS file?

    i.e.

    cmd_chk = uopy.Command('CHECK.SUM PYPROGS,U2DBLiveDMS excel_utils.py')

    Note another option to pull from the other directory, is to create a VOC entry that goes directly to that directory.



    ------------------------------
    Mike Rajkowski
    MultiValue Product Evangelist
    Rocket Internal - All Brands
    US
    ------------------------------

    Hi Mike

    I'll take a look into that



    ------------------------------
    Héctor Cortiguera
    Quiter Servicios Informaticos SL
    ------------------------------
    Héctor Cortiguera
    Participating Frequently
    Jun 2, 2025 8:44 AM UTC

    Hector,

    I prefer/recommend having two systems for test and live, so I did not look at this that much the first time, and expected someone else may be doing this and would make recommendations.  

    If I am reading your code correctly, your issue is with nested directories.

    Did you create U2DBLiveDMS from the UniVerse Command line

    i.e.

    >CREATE.FILE PYPROGS,U2DBLiveDMS 19
    Creating a multilevel data file.
    Creating file "PYPROGS/U2DBLiveDMS" as Type 19.
    Creating file "D_PYPROGS" as Type 3, Modulo 1, Separation 2.
    Added "@ID", the default record for RetrieVe, to "D_PYPROGS".

    How did you change the code to use the PYPROGS,U2DBLiveDMS file?

    i.e.

    cmd_chk = uopy.Command('CHECK.SUM PYPROGS,U2DBLiveDMS excel_utils.py')

    Note another option to pull from the other directory, is to create a VOC entry that goes directly to that directory.



    ------------------------------
    Mike Rajkowski
    MultiValue Product Evangelist
    Rocket Internal - All Brands
    US
    ------------------------------

    Hi Mike

    I just tried that, and got this error message

    >CREATE.FILE PYPROGS,U2DBLiveDMS 19
    "PYPROGS" is already in your VOC file as a file definition record.
    File not created.
    >CT VOC PYPROGS

         PYPROGS
    0001 F
    0002 PYPROGS
    0003 D_PYPROGS
    >

    I used 

    > CREATE.FILE DATA PYPROGS,U2DBLiveDMS

    Please enter the following information for the DATA file:

    Modulo           =  101
    Separation       =  1
    File type        =  19
    File description =  Modulo para u2dblive en pyprogs
    Creating a multilevel data file.
    Creating file "PYPROGS/U2DBLiveDMS" as Type 19.

    This creates a new folder inside PYPROGS but it has moved all the previous content of PYPROGS into another folder.cd PY

    SH-5.1$ find PYPROGS/ 
    PYPROGS/
    PYPROGS/PYPROGS
    PYPROGS/PYPROGS/basic_python_test.py
    PYPROGS/PYPROGS/search_up_bp.py
    PYPROGS/PYPROGS/lanza_metodo_min.py
    PYPROGS/PYPROGS/aws_boto3_context_manager.py
    ...
    PYPROGS/U2DBLiveDMS
    PYPROGS/U2DBLiveDMS/common.py
    PYPROGS/U2DBLiveDMS/file_stat.py
    PYPROGS/U2DBLiveDMS/u2dblive.py
    ...

    So now all the Python integration is broken.



    ------------------------------
    Héctor Cortiguera
    Quiter Servicios Informaticos SL
    ------------------------------
    -------------------------------------------

    Mike Rajkowski
    Rocketeer
    Jun 2, 2025 9:39 AM UTC

    Hi Mike

    I just tried that, and got this error message

    >CREATE.FILE PYPROGS,U2DBLiveDMS 19
    "PYPROGS" is already in your VOC file as a file definition record.
    File not created.
    >CT VOC PYPROGS

         PYPROGS
    0001 F
    0002 PYPROGS
    0003 D_PYPROGS
    >

    I used 

    > CREATE.FILE DATA PYPROGS,U2DBLiveDMS

    Please enter the following information for the DATA file:

    Modulo           =  101
    Separation       =  1
    File type        =  19
    File description =  Modulo para u2dblive en pyprogs
    Creating a multilevel data file.
    Creating file "PYPROGS/U2DBLiveDMS" as Type 19.

    This creates a new folder inside PYPROGS but it has moved all the previous content of PYPROGS into another folder.cd PY

    SH-5.1$ find PYPROGS/ 
    PYPROGS/
    PYPROGS/PYPROGS
    PYPROGS/PYPROGS/basic_python_test.py
    PYPROGS/PYPROGS/search_up_bp.py
    PYPROGS/PYPROGS/lanza_metodo_min.py
    PYPROGS/PYPROGS/aws_boto3_context_manager.py
    ...
    PYPROGS/U2DBLiveDMS
    PYPROGS/U2DBLiveDMS/common.py
    PYPROGS/U2DBLiveDMS/file_stat.py
    PYPROGS/U2DBLiveDMS/u2dblive.py
    ...

    So now all the Python integration is broken.



    ------------------------------
    Héctor Cortiguera
    Quiter Servicios Informaticos SL
    ------------------------------
    -------------------------------------------

    Hector,

    Hmmm.  In that case, your best case is to create two different VOC pointers to the different directories.  I was under the misconception, that I could set this up like I would in UniData, with a MULTIDIR file.



    ------------------------------
    Mike Rajkowski
    MultiValue Product Evangelist
    Rocket Internal - All Brands
    US
    ------------------------------
    Manu Fernandes
    Inspiring
    Jun 2, 2025 9:50 AM UTC

    Hi Mike

    I just tried that, and got this error message

    >CREATE.FILE PYPROGS,U2DBLiveDMS 19
    "PYPROGS" is already in your VOC file as a file definition record.
    File not created.
    >CT VOC PYPROGS

         PYPROGS
    0001 F
    0002 PYPROGS
    0003 D_PYPROGS
    >

    I used 

    > CREATE.FILE DATA PYPROGS,U2DBLiveDMS

    Please enter the following information for the DATA file:

    Modulo           =  101
    Separation       =  1
    File type        =  19
    File description =  Modulo para u2dblive en pyprogs
    Creating a multilevel data file.
    Creating file "PYPROGS/U2DBLiveDMS" as Type 19.

    This creates a new folder inside PYPROGS but it has moved all the previous content of PYPROGS into another folder.cd PY

    SH-5.1$ find PYPROGS/ 
    PYPROGS/
    PYPROGS/PYPROGS
    PYPROGS/PYPROGS/basic_python_test.py
    PYPROGS/PYPROGS/search_up_bp.py
    PYPROGS/PYPROGS/lanza_metodo_min.py
    PYPROGS/PYPROGS/aws_boto3_context_manager.py
    ...
    PYPROGS/U2DBLiveDMS
    PYPROGS/U2DBLiveDMS/common.py
    PYPROGS/U2DBLiveDMS/file_stat.py
    PYPROGS/U2DBLiveDMS/u2dblive.py
    ...

    So now all the Python integration is broken.



    ------------------------------
    Héctor Cortiguera
    Quiter Servicios Informaticos SL
    ------------------------------
    -------------------------------------------

    Sorry

    I make a mis take. 

    Neil Morris
    Rocketeer
    Jun 2, 2025 11:20 AM UTC

    Hector,

    Hmmm.  In that case, your best case is to create two different VOC pointers to the different directories.  I was under the misconception, that I could set this up like I would in UniData, with a MULTIDIR file.



    ------------------------------
    Mike Rajkowski
    MultiValue Product Evangelist
    Rocket Internal - All Brands
    US
    ------------------------------

    With a UniVerse multi-level, the expectation is that each entry in the top level directory is a UniVerse file. Since PYPROGS already existed when making it a multi-level file, it made it a subfile in the top level PYPROGS directory. And from within UniVerse, the files would be accessed via PYPROGS,PYPROGS and PYPROGS,U2DBLiveDMS. From a UV perspective for accessing the file, I don't think you can have the top level directory filled with a bunch of text files and also have a sub directory filled with a bunch of text files. 



    ------------------------------
    Neil Morris
    Universe Advanced Technical Support
    Rocket Software
    ------------------------------