Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error in dired sorting on OS X

Tags:

On OS X 10.5 Emacs 23.2, in dired-mode, if I try to sort by dired-sort-toggle-or-edit with prefix argument --sort=extension or -X, I get:

insert-directory: Listing directory failed but `access-file' worked 

and the dired buffer becomes empty. I tried setting

(setq dired-use-ls-dired nil) 

but this had no effect. dired-sort-toggle-or-edit and sorting by extension seems to work okay on my Ubuntu box. Anyone have a clue what's going on?

like image 488
hatmatrix Avatar asked Nov 02 '10 09:11

hatmatrix


2 Answers

For now, I've also found another solution using ls-lisp

(when (eq system-type 'darwin)   (require 'ls-lisp)   (setq ls-lisp-use-insert-directory-program nil)) 
like image 115
hatmatrix Avatar answered Sep 28 '22 06:09

hatmatrix


The ls that's installed on OS X doesn't support -X or any long arguments like --sort. Setting dired-use-ls-dired won't have any effect; dired will always use ls, but if that variable is non-nil, it will pass --dired to ls.

If you want that type of sorting, you can probably use something like fink to install coreutils, which will provide an ls more like what you're used to in Ubuntu.

like image 43
Eric Warmenhoven Avatar answered Sep 28 '22 08:09

Eric Warmenhoven