29
29
def cat(file, text, end=''):
30
30
if os.path.isfile(file) and os.stat(file).st_size != 0:
31
31
# skip if a file exists and non-zero content
34
34
path = os.path.dirname(file)
36
36
os.makedirs(path, exist_ok=True)
37
37
with open(file, 'w') as f:
38
38
print(text, file=f, end=end)
42
42
#######################################################################