1

I have a command that involves ctags to index a large directory using python. It goes like this:

cmd = ['ctags', '-R', '-f', 'tagfile', 'my_large_dir']
subprocess.call(cmd)
#wait for ctags to finish then go on

This works perfectly on Win 7 and Ubuntu but not on Mac OSX Mavericks.

I then try to run the actual ctags command from the terminal and it works fine.

I then try to run a touch command from python to see if python has some aversion to creating files in my directory, and that works fine.

However, when I run the command above, it just hangs on the subprocess call.

Any ideas? I'm stumped and I need to figure this out by Friday :(

Update:

I forgot to mention that I had already installed the correct version of ctags from Homebrew. As ren pointed out though, when I used brew install ctags (notice NOT using sudo) it was placed into /usr/local/bin/ctags when I was looking in /usr/bin/ctags, which still had the wrong version I believe. For some reason, the version in /usr/bin/ just hung like it had an infinite loop somewhere...wierd.

Anyway, I pointed the command to the right path and it worked.

0

2 Answers 2

1

This would most likely be because of the incompatibility between GNU ctags and OSX/BSD ctags. For instance, OSX/BSD ctags does not accept the -R command line argument.

If you absolutely need the ability to recurse (which you probably do), I would suggest you install GNU or exuberant ctags via Homebrew.

0

You are probably trying to run the ctags that comes with XCode.

To use the actual ctags you are looking for:

1) If you haven't installed brew already install it -> http://brew.sh/

2) If you haven't already installed the ctags you are actually looking for:

brew install ctags

3) Then try running this ctags as: /usr/local/bin/ctags instead of just writing ctags

Incase you can't find ctags in the directory I wrote, try running it like this ->

`brew --prefix`/bin/ctags

(yes with the quotes)

2
  • 1
    The whole point and raison d'etre of Homebrew is so you do not have to use sudo. Dec 17, 2013 at 22:06
  • I already had done this but I was using the wrong ctags. I was using the one in my /usr/bin dir which was wrong. Thanks for the correction. Once I specified /usr/local/bin/ctags it worked like a charm :) Dec 17, 2013 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.