GW2DetermineFileTypeAndReport
The GW2DetermineFileTypeAndReport function determines the file type for a given file and produces a report. This is not related to a session.
- C++
- C#
- Java
- Python
- JavaScript
#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.
Synopsis
Returns
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.
Synopsis
Returns
Synopsis
Returns