<commit_before>// Copyright (c) .NET Foundation and contributors. All rights reserved. 
// Licensed under the MIT license. See LICENSE file in the project root for full license information. 

using Newtonsoft.Json;
using Newtonsoft.Json.Linq; 
using System.IO;
 
namespace Microsoft.DotNet.Cli.Utils
{ 
    public class RuntimeConfig 
    { 
        public bool IsPortable { get; } 
        public RuntimeConfigFramework Framework { get; } 
 
        public RuntimeConfig(string runtimeConfigPath) 
        {
            JObject runtimeConfigJson;
            using (var streamReader = new StreamReader(new FileStream(runtimeConfigPath, FileMode.Open)))
            {
                runtimeConfigJson = OpenRuntimeConfig(streamReader);
            }
<commit_msg>Changing to use File.OpenRead. This is required because when access readonly files, you must pass FileAccess.Read, otherwise, we get a UnauthorizedFileAccess exception.<commit_after>// Copyright (c) .NET Foundation and contributors. All rights reserved. 
// Licensed under the MIT license. See LICENSE file in the project root for full license information. 

using Newtonsoft.Json;
using Newtonsoft.Json.Linq; 
using System.IO;
 
namespace Microsoft.DotNet.Cli.Utils
{ 
    public class RuntimeConfig 
    { 
        public bool IsPortable { get; } 
        public RuntimeConfigFramework Framework { get; } 
 
        public RuntimeConfig(string runtimeConfigPath) 
        {
            JObject runtimeConfigJson;
            using (var streamReader = new StreamReader(File.OpenRead(runtimeConfigPath)))
            {
                runtimeConfigJson = OpenRuntimeConfig(streamReader);
            }

{'fraction_non_alphanumeric': 0.06486486486486487, 'fraction_numerical': 0.0, 'mean_word_length': 2.8211009174311927, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5004377', 'n_tokens_mistral': 416, 'n_tokens_neox': 393, 'n_words': 137}