can write the pattern to file and read the pattern from the file