# TryGetFilePath(GUID, string, out string)

> Attempts to get the path to a specific file within a build's metadata folder.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Build](/engine/6000.7/script-reference/unityeditor/build.md)
* **Assembly:** UnityEditor.CoreModule

## TryGetFilePath(GUID, string, string)

```csharp
public static bool TryGetFilePath(GUID buildSessionGuid, string filename, out string filePath)
```

### Parameters

**** (GUID): The unique session GUID of the build to search within.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the file to locate, for example `contentlayout.json`.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): When this method returns, contains the absolute path to the file if it exists.

### Returns

| Type                                                          | Description                                                                    |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if the build is tracked and the file exists on disk; otherwise `false`. |

### Examples

```csharp
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;

public class GetTepFileExample
{
    [MenuItem("Example/BuildHistory/Get Build Performance Profiling File Path")]
    static public void GetTraceEventFilePath()
    {
        // Example showing how to get the path to the trace event file
        // recording build performance profiling information about the latest build.
        if (!BuildHistory.TryGetLatestBuild(out GUID latestBuildGuid))
        {
            Debug.Log("No builds found in build history.");
            return;
        }

        // Check if the latest build wrote a profiler file
        string tepFilename = "BuildContentTEP.json";
        if (BuildHistory.TryGetFilePath(latestBuildGuid, tepFilename, out string tepFilePath))
        {
            Debug.Log($"Found Trace Event file for latest build: {tepFilePath}.");
        }
        else
        {
            // The file might not exist if the latest build wasn't a ContentDirectory build.
            Debug.Log($"Trace Event file '{tepFilename}' not found for the latest build.");
        }
    }
}
```
