Write and Mkdir perform the equivalent of 'mkdir -p'

Signed-off-by: David Scott <dave.scott@citrix.com>