def save_file(f, full_path):
make_dirs_for_file_path(full_path, mode=dju_settings.DJU_IMG_CHMOD_DIR)<EOL>with open(full_path, '<STR_LIT:wb>') as t:<EOL><INDENT>f.seek(<NUM_LIT:0>)<EOL>while True:<EOL><INDENT>buf = f.read(dju_settings.DJU_IMG_RW_FILE_BUFFER_SIZE)<EOL>if not buf:<EOL><INDENT>break<EOL><DEDENT>t.write(buf)<EOL><DEDENT><DEDENT>os.chmod(full_path, dju_settings.DJU_IMG_CHMOD_FILE)<EOL>
Saves file f to full_path and set rules.