# 2. Функции

## pyOpenRPA.Agent.__Agent__

**Functions:**

| `OSCMD`(inCMDStr[, inRunAsyncBool, …])

 | Execute CMD on the Agent daemonic process

 |
| `OSFileBinaryDataBase64StrAppend`(…[, …])

 | Create binary file by the base64 string (safe for JSON transmition)

 |
| `OSFileBinaryDataBase64StrCreate`(…[, …])

 | Create binary file by the base64 string (safe for JSON transmition)

 |
| `OSFileBinaryDataBase64StrReceive`(inFilePathStr)

 | Read binary file and encode in base64 to transmit (safe for JSON transmition)

 |
| `OSFileMTimeGet`(inFilePathStr)

                   | Read file modification time timestamp format (float)

                          |
| `OSFileTextDataStrCreate`(inFilePathStr, …)

       | Create text file in the agent GUI session

                                     |
| `OSFileTextDataStrReceive`(inFilePathStr[, …])

    | Read text file in the agent GUI session

                                       |
| `ProcessWOExeUpperUserListGet`()

                  | Return the process list only for the current user (where Agent is running) without .EXE in upper case.

 |

### pyOpenRPA.Agent.__Agent__.OSCMD(inCMDStr, inRunAsyncBool=True, inGSettings=None, inSendOutputToOrchestratorLogsBool=True, inCMDEncodingStr='cp1251', inCaptureBool=True)
Execute CMD on the Agent daemonic process


* **Параметры**

    
    * **inCMDStr** – command to execute on the Agent session


    * **inRunAsyncBool** – True - Agent processor don’t wait execution; False - Agent processor wait cmd execution


    * **inGSettings** – Agent global settings dict


    * **inSendOutputToOrchestratorLogsBool** – True - catch cmd execution output and send it to the Orchestrator logs; Flase - else case; Default True


    * **inCMDEncodingStr** – Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is «cp1251» early was «cp866» - need test


    * **inCaptureBool** – !ATTENTION! If you need to start absolutely encapsulated app - set this flag as False. If you set True - the app output will come to Agent



* **Результат**

    


### pyOpenRPA.Agent.__Agent__.OSFileBinaryDataBase64StrAppend(inFilePathStr, inFileDataBase64Str, inGSettings=None)
Create binary file by the base64 string (safe for JSON transmition)


### pyOpenRPA.Agent.__Agent__.OSFileBinaryDataBase64StrCreate(inFilePathStr, inFileDataBase64Str, inGSettings=None)
Create binary file by the base64 string (safe for JSON transmition)


### pyOpenRPA.Agent.__Agent__.OSFileBinaryDataBase64StrReceive(inFilePathStr, inGSettings=None)
Read binary file and encode in base64 to transmit (safe for JSON transmition)


* **Параметры**

    
    * **inFilePathStr** – File path to read


    * **inGSettings** – global settings of the Agent (singleton)



* **Результат**

    File content in string base64 format (use base64.b64decode to decode data). Return None if file is not exist



### pyOpenRPA.Agent.__Agent__.OSFileMTimeGet(inFilePathStr: str)
Read file modification time timestamp format (float)


* **Параметры**

    **inFilePathStr** – File path to read



* **Результат**

    timestamp (float) Return None if file is not exist



### pyOpenRPA.Agent.__Agent__.OSFileTextDataStrCreate(inFilePathStr, inFileDataStr, inEncodingStr='utf-8', inGSettings=None)
Create text file in the agent GUI session


* **Параметры**

    
    * **inFilePathStr** – File abs path


    * **inFileDataStr** – File data text content


    * **inEncodingStr** – Write file encoding


    * **inGSettings** – global settings of the Agent (singleton)



* **Результат**

    


### pyOpenRPA.Agent.__Agent__.OSFileTextDataStrReceive(inFilePathStr, inEncodingStr='utf-8', inGSettings=None)
Read text file in the agent GUI session


* **Параметры**

    
    * **inFilePathStr** – File abs path


    * **inEncodingStr** – Read file encoding. Default utf-8


    * **inGSettings** – global settings of the Agent (singleton)



* **Результат**

    File text content in string format (use base64.b64decode to decode data). Return None if file is not exist



### pyOpenRPA.Agent.__Agent__.ProcessWOExeUpperUserListGet()
Return the process list only for the current user (where Agent is running) without .EXE in upper case. Can use in ActivityItem from Orchestrator to Agent


* **Параметры**

    **inProcessNameWOExeList** – 



* **Результат**

    list of the agent user process in upper case without .EXE. Example [«NOTEPAD»,»…»],


		.. v1.2.14 replace:: v1.2.14