Update class.php

Added openfile function