import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'


The **GW2RegisterExportTextDumpFile** function registers a specified file path to session - the exported text dump data will be placed in that file. Using this function activates the Text Dump Option for the Export Process Mode for the session. More information on supported file formats and Text Dump limitations can be found on the [Content Export & Import](/embedded-engine/embedded-engine-content-export-and-import) page.

<Tabs>

<TabItem value="C++" label="C++" default>

**Synopsis**

The **GW2RegisterExportTextDumpFile** function registers the file whose name is the string pointed to by **textDumpFilePathName** with the session denoted by **session.** The exported text dump data will be placed in that file. Using this function activates the Text Dump Option for Export Process Mode for the session.

```cpp

#include "glasswall.core2.api.h"
int GW2RegisterExportTextDumpFile(
    Session session,
    const char *textDumpFilePathName);

```

**Returns**

Returns an integer `GW2_RetStatus` enum value. Negative numbers indicate a failure.

</TabItem>

<TabItem value="C#" label="C#">

**Synopsis**

```csharp
public int RegisterTextDumpFile(
    int session,
    string textDumptFilePath)

```

**Returns**

Returns an integer `GW2_RetStatus` enum value. Negative numbers indicate a failure.

</TabItem>

<TabItem value="Java" label="Java">

**Synopsis**

```java
import com.glasswall.core2javabridge.*;

public int GW2RegisterExportTextDumpFile(int session, String exportTextDumpFilePath) throws GlasswallException, NullPointerException

(Deprecated)
public int GW2RegisterExportTextDumpFile(int session, byte[] exportTextDumpFilePath) throws GlasswallException, NullPointerException
```

**Note**

The **GW2RegisterExportTextDumpFile** function parameters have been updated to use `String` in place of `byte[]`. The original function has been deprecated.

**Returns**

The **GW2RegisterExportTextDumpFile** function returns a **GW2_RetStatus** enumeration converted to `int`. The value will be negative if an error occurred. `0` indicates success. Refer to the API Overview/Return types for details. 

A **NullPointerException** exception will be thrown if `exportTextDumpFilePath` is null or empty.

A **GlasswallException** exception will be thrown if `session` is invalid, if the `exportTextDumpFilePath` could not be retrieved, or if the `exportTextDumpFilePath` could not be converted to UTF-8.

</TabItem>

<TabItem value="Python" label="Python">

**Synopsis**

Registers a text dump file to be exported for the given session. The export text dump file will be created during the session's run_session call.

```py
def _GW2RegisterExportTextDumpFile(self, session: int, output_file: str):
    """ Registers an export text dump to be written to file.

    Args:
        session (int): The session integer.
        output_file (str): The file path of the text dump file.

    Returns:
        gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'session', 'output_file', 'status'.
    """
```

**Returns**

gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'session', 'output_file', 'status'.

The status attribute is an integer `GW2_RetStatus` enum value. Negative numbers indicate a failure.

</TabItem>

<TabItem value="JavaScript" label="JavaScript">

**Synopsis**

This function registers a specified export file with a specified session

```jsx

/**
* @param {number} session The ID of the session.
* @param {string} textDumpFilePathName The path of the file to be registered.
*/

 GW2RegisterExportTextDumpFile(session, textDumpFilePathName)

```

**Returns**

Returns an integer `GW2_RetStatus` enum value. Negative numbers indicate a failure.

</TabItem>

</Tabs>