internal static bool ReadFileContentBinary(string assetPath, out byte[] fileContent, out string errorMessage) { fileContent = null; errorMessage = null; string absolutePath = FileUtil.PathToAbsolutePath(assetPath); try { fileContent = File.ReadAllBytes(absolutePath); } catch (Exception e) { fileContent = null; errorMessage = e.Message; } return(fileContent != null); }
internal static bool MakeWritable(string path) { string absolutePath = FileUtil.PathToAbsolutePath(path); if (Directory.Exists(absolutePath)) { foreach (var file in GetAllFilesRecursive(absolutePath)) { var fileInfo = new FileInfo(file); fileInfo.IsReadOnly = false; } return(true); } if (File.Exists(absolutePath)) { var fileInfo = new FileInfo(absolutePath); fileInfo.IsReadOnly = false; return(true); } return(false); }