MCPcopy Create free account
hub / github.com/argotorg/solidity / read_file

Function read_file

scripts/error_codes.py:13–23  ·  view source on GitHub ↗
(file_name)

Source from the content-addressed store, hash-verified

11
12
13def read_file(file_name):
14 content = None
15 _, tail = path.split(file_name)
16 is_latin = tail == "invalid_utf8_sequence.sol"
17 try:
18 with open(file_name, "r", encoding="latin-1" if is_latin else ENCODING) as f:
19 content = f.read()
20 finally:
21 if content is None:
22 print(f"Error reading: {file_name}")
23 return content
24
25
26def write_file(file_name, content):

Callers 4

find_ids_in_source_fileFunction · 0.85
fix_ids_in_source_fileFunction · 0.85
find_ids_in_test_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected