def escape_file_name(name):
    """No filesystems can handle a null or a slash in a file or directory
    name so we replace those with a string saying what it is.  Note that
    any names with any other (unicode) characters will still be preserved in
    the file name which may nor may not cause you problems."""

    return name.replace("\x00", "[null]").replace("/", "[slash]")