# GetFileName()

Returns the name and path of the nth file in the directory containing binary log files.

Member of the DataLogger class.

## Function Prototype

VB .NET

Public Shared Function GetFileName(ByVal fileNumber As Integer, ByRef path As String, ByRef fileName As String) As MccDaq.ErrorInfo

C# .NET

public static MccDaq.ErrorInfo GetFileName(int fileNumber, ref string path, ref string fileName)

## Parameter

fileNumber

Index of the file whose name you want to return. Specify one of the following:

- The number (n) that represents the location of the file in the directory (where n = 0, 1, 2, and so on), or
- MccService.GetFirst – get the first file in the directory, or
- MccService.GetNext – get the next file in the directory, based on the current index.

This parameter is the index of the file in the directory, and is not part of the filename.

path

The full path of the directory containing the log files.

fileName

The full path and name of the binary file. The path must be null-terminated and cannot be longer than 256 characters.

## Returns

- An ErrorInfo object that indicates the status of the operation.
- fileName – Returns the file name and path of the binary file.

## Notes

- To access all of the files in a directory, first call GetFileName() with fileNumber set to MccService.GetFirst, then again with fileNumber set to MccService.GetNext until the method returns the error code NOMOREFILES.