- """A helper that writes a file to a temporary location and then moves
- it atomically to its ultimate destination on close.
+ """A helper that writes a file to a temporary location and then
+ moves it atomically to its ultimate destination on close.
+
+ Example usage. Creates a temporary file that is populated by the
+ print statements within the context. Until the context is exited,
+ the true destination file does not exist so no reader of it can
+ see partial writes due to buffering or code timing. Once the
+ context is exited, the file is moved from its temporary location
+ to its permanent location by a call to `/bin/mv` which should be
+ atomic::
+
+ with FileWriter('/home/bob/foobar.txt') as w:
+ print("This is a test!", file=w)
+ time.sleep(2)
+ print("This is only a test...", file=w)
+