The ctags command doesn't recurse saying "it is not a regular file"
Asked Answered
W

2

36

When I run ctags -R *, I get errors saying that all directories are not regular files and it skips them instead of recursively generating tags for them.

ctags: skipping arpa: it is not a regular file.
ctags: skipping asm: it is not a regular file.
ctags: skipping asm-generic: it is not a regular file.
ctags: skipping bits: it is not a regular file.
ctags: skipping blkid: it is not a regular file.
ctags: skipping boost: it is not a regular file.

What is the problem?

Whispering answered 3/6, 2010 at 17:59 Comment(0)
W
73

Similar to this and this, the problem is you're not running Exuberant Ctags, you're running GNU Emacs etags, which also provides a ctags executable. Run ctags --version and you'll see something like this:

ctags (GNU Emacs 23.1)
Copyright (C) 2009 Free Software Foundation, Inc.
This program is distributed under the terms in ETAGS.README

And if you look in the man page, you'll see that -R is actually equivalent to --no-regex. In fact, the man page doesn't even mention recursion as an option.

   -R, --no-regex
          Don't  do  any more regexp matching on the following files.  May
          be freely intermixed with filenames and the --regex option.

You could probably generate the tags recursively using shell magic, but you may run into problems down the road if you're expecting Exuberant Ctags. So the best solution is probably to install the ctags you want instead:

sudo apt-get install exuberant-ctags

Exuberant Ctags can also be installed from source:

http://ctags.sourceforge.net/
Whispering answered 3/6, 2010 at 18:0 Comment(1)
(a straightforward search for problem terms on google turns up nothing useful, so hopefully this will help people in the future)Whispering
D
8

It occurs if you have elvis-tools installed . remove them with something like

sudo apt-get remove elvis-tools 

and then install exuberant-ctags by

sudo apt-get install exuberant-ctags
Daynadays answered 12/7, 2012 at 9:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.