Originally Posted by
Negata
If you don't like long code, seriously, quit, especially if you feel 5 lines is long. It's not like people give long examples just to be mean, if they're long it usually means it can't be done in a shorter way...
As for your current problem, you might get better search results if you try "executing" a file, cause "opening" a file in coding terms really means opening it and working with its contents in your own ways. If you execute a file from within your own program, it pretty much means you're telling another program to *open* it.