def _fsync_files(filenames):
touched_directories = set()<EOL>mode = os.O_RDONLY<EOL>if hasattr(os, '<STR_LIT>'):<EOL><INDENT>mode |= os.O_BINARY<EOL><DEDENT>for filename in filenames:<EOL><INDENT>fd = os.open(filename, mode)<EOL>os.fsync(fd)<EOL>os.close(fd)<EOL>touched_directories.add(os.path.dirname(filename))<EOL><DEDENT>if hasattr(os, '<STR_LIT>'):<EOL><INDENT>for dirname in touched_directories:<EOL><INDENT>fd = os.open(dirname, os.O_RDONLY | os.O_DIRECTORY)<EOL>os.fsync(fd)<EOL>os.close(fd)<EOL><DEDENT><DEDENT>
Call fsync() a list of file names

    The filenames should be absolute paths already.