BUTR/Bannerlord.BUTRLoader

View on GitHub
src/Bannerlord.BUTRLoader.AssemblyManager/NtfsUnblocker.cs

Summary

Maintainability
A
0 mins
Test Coverage
using System.Runtime.InteropServices;

using Windows.Win32;

namespace Bannerlord.BUTRLoader.AssemblyManager;

internal static class NtfsUnblocker
{
    public static void UnblockFile(string fileName)
    {
        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            PInvoke.DeleteFile($"{fileName}:Zone.Identifier");
    }
}