blob: 4e6c9cf452f76cfa1c785e56af40a603cb8854e5 (
plain) (
tree)
|
|
#!/usr/bin/env python3
import sys
buf = ""
with open(sys.argv[1], 'r+b') as f:
buf = f.read()
if buf.find(b'\r\n'):
print(f"{sys.argv[1]} is already a CRLF file")
sys.exit(1)
buf = buf.replace(b'\n', b'\r\n')
with open(sys.argv[1], 'w+b') as f:
f.write(buf)
|