def check_write_permissions(file):
try:<EOL><INDENT>open(file, '<STR_LIT:a>')<EOL><DEDENT>except IOError:<EOL><INDENT>print("<STR_LIT>"<EOL>"<STR_LIT>".format(file))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>
Check if we can write to the given file

Otherwise since we might detach the process to run in the background
we might never find out that writing failed and get an ugly
exit message on startup. For example:
ERROR: Child exited immediately with non-zero exit code 127

So we catch this error upfront and print a nicer error message
with a hint on how to fix it.