Files
IfcOpenShell/src/ifcopenshell-python/ifcopenshell/express/cat.py
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
387 B
Python
Raw Normal View History

import sys, fileinput
2026-02-26 12:36:01 +01:00
if sys.platform == "win32" and not hasattr(sys.stdout, "buffer"):
import os, msvcrt
2026-02-26 12:36:01 +01:00
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
files = sys.argv[1:]
2026-02-26 12:36:01 +01:00
if files[0] == "-o":
b = open(files[1], "wb")
files = files[2:]
else:
2026-02-26 12:36:01 +01:00
b = getattr(sys.stdout, "buffer", sys.stdout)
2026-02-26 12:36:01 +01:00
for line in fileinput.input(files=files, mode="rb"):
b.write(line)