MCPcopy Create free account
hub / github.com/saltstack/salt / _is_text_file

Function _is_text_file

salt/modules/snapper.py:553–563  ·  view source on GitHub ↗

Checks if a file is a text file

(filename)

Source from the content-addressed store, hash-verified

551
552
553def _is_text_file(filename):
554 """
555 Checks if a file is a text file
556 """
557 type_of_file = subprocess.run(
558 ["file", "-bi", filename],
559 check=False,
560 stdout=subprocess.PIPE,
561 text=True,
562 ).stdout
563 return type_of_file.startswith("text")
564
565
566def run(function, *args, **kwargs):

Callers 1

diffFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected