If it's a file, edit it, if it's a directory, list it.