chdir to the directory of openned file