example program of opening and closing files