Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ctags error "Is a directory"

Tags:

c++

ctags

I was trying to tag a C++ project with ctags with the options as listed in this answer C++ source tagging. I am in a project tree that contains multiple folders and those folders contain source files. I have tried the following to tag the entire source tree

ctags --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ -R .
find . -type f \( -iname "*.cpp" -o -iname "*.hpp" \) | xargs ctags --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++
ctags -R . 
ctags -R *

and all of the above give the same error

ctags: Failure on attempt to read file : Is a directory

How do I go about fixing this?

like image 225
Curious Avatar asked Jan 04 '17 02:01

Curious


People also ask

Can I run ctags on all files in a directory?

This permits running ctags on all files in either a single directory (e.g. “ ctags * ”), or on all files in an entire source directory tree (e.g. “ ctags -R ”), since only those files whose names are mapped to languages will be scanned. An extension may be mapped to multiple parsers.

How does ctags determine file language?

As ctags considers each source file name in turn, it tries to determine the language of the file by applying tests described in “ Determining file language ”. If a language was identified, the file is opened and then the appropriate language parser is called to operate on the currently open file.

Why is ctags not creating the inputfile/F extra tag?

By default, ctags doesn’t create the inputFile / f extra tag for the source file when ctags doesn’t find a parser for it. Enabling Unknown parser with --languages=+Unknown forces ctags to create the extra tags for any source files.

Are there any issues with mapping in ctags?

These mappings can cause issues. ctags tries to select the proper parser for the source file by applying heuristics to its content, however it is not perfect. In case of issues one can use --language-force=<language> , --langmap=<map> [,<map> [...]], or the --map-<LANG>= [+|-]<extension>|<pattern> options.


1 Answers

Turns out this was a case insensitive filesystem problem. The MacOSX I am on has case insensitive files and as a result a folder named Tags was affecting the ctags program. Removing the Tags folder or causing ctags to output to another file with the -f flag fixed the issue.

like image 53
Curious Avatar answered Oct 17 '22 03:10

Curious