import os
from contextlib import contextmanager
from .core import AtomicWriter


def touch(fname, times=None):
    with open(fname, 'a'):
        os.utime(fname, times)


@contextmanager
def atomic_write(filename, mode='w', read_mode='r'):
    touch(filename)
    writer = AtomicWriter(filename, mode=mode)
    with writer.context() as w:
        with open(filename, mode=read_mode) as r:
            yield r, w

@@ -1,243 +1,950 @@
-import os%0Afrom contextlib import contextmanager%0Afrom .core import AtomicWriter%0A%0A%0Adef touch(fname, times=None):%0A    with open(fname, 'a'):%0A        os.utime(fname, times)%0A%0A%0A@contextmanager%0Adef atomic_write(filename, mode='w', read_mode='r'):
+%22%22%22%0A    atomicio.api%0A    ~~~~~~~~~~~~%0A%0A    Implements the functional API over the lower%0A    level, more verbose class machinery.%0A%22%22%22%0A%0Aimport os%0Afrom contextlib import contextmanager%0Afrom .core import AtomicWriter%0A%0A%0Adef touch(fname, times=None):%0A    %22%22%22%0A    Create *fname* if it doesn't exist, else modifies%0A    the last accessed *times* like the unix %60%60touch%60%60%0A    utility.%0A%0A    :param *fname*: Name of the file.%0A    :param times: The access and modified times, or%0A        None for the current time.%0A    %22%22%22%0A    with open(fname, 'a'):%0A        os.utime(fname, times)%0A%0A%0A@contextmanager%0Adef atomic_write(filename, mode='w', read_mode='r'):%0A    %22%22%22%0A    Given a *filename*, yields a pair of readable and%0A    writable opened with *read_mode* and *write_mode*%0A    (respectively) file streams.%0A%0A    :param filename: A string filename%0A    :param mode: Mode to open the writer stream with.%0A    :param read_mode: Mode to open the reader stream with.%0A    %22%22%22
 %0A   

update docs [skip ci]