checks if file is open
added default main for using a dfa