# GetFileInfo(string, FileInfoResult*)

> Gets information about a file.

## Definition

* **Type:** Method
* **Namespace:** [Unity.IO.LowLevel.Unsafe](/engine/6000.5/script-reference/unity/io/lowlevel/unsafe.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static ReadHandle GetFileInfo(string filename, FileInfoResult* result)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the file to query.**** (\[FileInfoResult\*]\(/engine/6000.5/script-reference/unity/io/lowlevel/unsafe/fileinforesult)): A struct that this function fills in with information about the file upon completion of this asynchronous request.

### Returns

| Type                                                                                 | Description                                                                                    |
| ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
| [ReadHandle](/engine/6000.5/script-reference/unity/io/lowlevel/unsafe/readhandle.md) | A read handle that you can use to monitor the progress and status of this GetFileInfo command. |

### Remarks

This function gets information about the specified file asynchronously without opening the file. On completion of the asynchronous operation, the `result` parameter's [FileInfoResult.FileState](/engine/6000.5/script-reference/unity/io/lowlevel/unsafe/fileinforesult/filestate.md) member reports whether the file exists ([FileState.Exists](/engine/6000.5/script-reference/unity/io/lowlevel/unsafe/filestate/exists.md)) or not ([FileState.Absent](/engine/6000.5/script-reference/unity/io/lowlevel/unsafe/filestate/absent.md)). If the file exists, the `result` parameter's [FileInfoResult.FileSize](/engine/6000.5/script-reference/unity/io/lowlevel/unsafe/fileinforesult/filesize.md) member reports the size of the file in bytes. If the file is absent, the size is reported as zero.
