utilisation de openFileOrDirectory, refactor