GW2DetermineFileTypeAndReport

Prev Next

The GW2DetermineFileTypeAndReport function determines the file type for a given file and produces a report. This is not related to a session.

#include "glasswall.core2.api.h"
ft_t GW2DetermineFileTypeAndReport(const char *inputFileBuffer, size_t inputLength, const char *report)

Parameters

โ€ƒ inputFileBuffer The memory location containing the file to be processed by this function.

โ€ƒ inputLength The length of 'inputFileBuffer' in bytes

โ€ƒ report The path to a plain text file where the report will be written,. If the file doesn't exist it will be created

Returns

โ€ƒ Enumerated type 'ft_t' indicating the determined file type. If the file type cannot be determined then 'ft_unknown ' will be returned.

Not supported in C#

Synopsis

public int GW2DetermineFileTypeAndReport(byte[] fileBuffer, String reportFilePath) throws GlasswallException, NullPointerException
public int GW2DetermineFileTypeAndReport(byte[] fileBuffer, int length, String reportFilePath) throws GlasswallException, NullPointerException

Description

The GW2DetermineFileTypeAndReport function determines the file type of the file held in the byte array fileBuffer and writes out a summary XML report to the path specified in reportFilePath. The length of the fileBuffer may optionally be specified.

Returns

The GW2DetermineFileTypeAndReport function returns an integer indicating the determined file type. A list of the enumeration constants is in the C source header file filetype.h. A return value of 0 indicates the file type can't be determined.

If successful, an XML report will be written to the path specified in reportFilePath.

A NullPointerException exception will be thrown if fileBuffer or reportFilePath buffers are null or empty.

A GlasswallException exception will be thrown if fileBuffer cannot be retrieved, or if the reportFilePath could not be converted to UTF-8.

Not supported in Python

Not supported in Javascript