diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Shader/Cache/CacheHelper.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Shader/Cache/CacheHelper.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Shader/Cache/CacheHelper.cs b/Ryujinx.Graphics.Gpu/Shader/Cache/CacheHelper.cs index d10e4671..d109f1cd 100644 --- a/Ryujinx.Graphics.Gpu/Shader/Cache/CacheHelper.cs +++ b/Ryujinx.Graphics.Gpu/Shader/Cache/CacheHelper.cs @@ -496,5 +496,27 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache } } } + + public static bool IsArchiveReadOnly(string archivePath) + { + FileInfo info = new FileInfo(archivePath); + + if (!info.Exists) + { + return false; + } + + try + { + using (FileStream stream = info.Open(FileMode.Open, FileAccess.Read, FileShare.None)) + { + return false; + } + } + catch (IOException) + { + return true; + } + } } } |