    

 ## On this page

  

 

 # Class FileUtility

 Last update: 09.03.2026 

Namespace: [OpenTD.Utility](OpenTD.Utility.md)  
Assembly: OpenTD.dll

Utility methods for working with files.

```csharp
public static class FileUtility

```

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [FileUtility](OpenTD.Utility.FileUtility.md)

## Inherited Members

[object.Equals(object?)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)), [object.Equals(object?, object?)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object?, object?)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Methods

### GetEndOfPath(string)

Returns either the filename or directory name at the end of the input path.

```csharp
public static string GetEndOfPath(string path)

```

#### Parameters

`path` [string](https://learn.microsoft.com/dotnet/api/system.string)

The path.

#### Returns

[string](https://learn.microsoft.com/dotnet/api/system.string)

System.String.

### IsDirectory(string)

Determines whether the specified path is a directory.

```csharp
public static bool IsDirectory(string path)

```

#### Parameters

`path` [string](https://learn.microsoft.com/dotnet/api/system.string)

The path.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

`true` if the specified path is a directory; otherwise, `false`.

### IsFileLocked(FileInfo)

Determines whether a file is locked for use.

```csharp
public static bool IsFileLocked(FileInfo file)

```

#### Parameters

`file` [FileInfo](https://learn.microsoft.com/dotnet/api/system.io.fileinfo)

The file.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)