Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I've been trying to make a tag about questions related to how programs can determine their own filesystem path at runtime, because it is very hard to find such questions through keyword search -- there just doesn't seem to be a keyword for it.

The best name I could come up with for the tag was . (See the "Proposed wiki" section for an explanation of the reasoning behind the tag name.)

I created the tag a couple of days ago, tagged 20 or so questions with it, and proposed a small tag wiki.

Unfortunately, someone decided he didn't like my tag, and untagged everything I had tagged, with messages like "We already have [argv], we don't need [argv0]. Manually burninating." For example, see

For some reason, I tried tagging one of the questions again to see if it was just a fluke, but someone else just rolled it back to the "burninating" edit. Since starting an edit war was not my goal, I decided not to try tagging anything else for the time being.

So, I assumed that either this had happened before my proposed tag wiki got looked at, or the wiki wasn't clear enough about what the tag was for, so I tried again with something longer, which was approximately the contents of the "Proposed wiki" section below. (Some details may have differed, because I forgot to save exactly the version I submitted, and I can't exactly retrieve it from the system now...)

I also attempted to prevent immediate disapproval by including the following plea as a comment:

<!-- NOTE: If you don't like this tag, please think of a better name, copy most of this content there, and tag with it. -->

This does not seem to have had any effect; perhaps the tag wiki edit approval UI does not show the source code?

Proposed wiki

Questions about how a program can (and can't) find the path from which it is executing. Named after, but not limited to, argv[0] in C, which always seems like it should help, but is actually totally inadequate for the task.

Whereas the tag is about dealing with POSIX/C-style (command-line) arguments in <language>, this tag is about how a program may (and may not) determine its own location at runtime.

This tag is named after C's argv[0], because it always seems like it ought to help with this kind of thing. However, C's argv[0] is actually not at all reliable, for reasons covered pretty well in the question "how to find the location of the executable in C". Implementing this at all reliably therefore requires use of platform-specific interfaces. Really messy.

In other words, the tag name is essentially a mnemonic lie!

The same problem will of course afflict any other platform-neutral compiled-to-native-executable language in the same way, assuming it even provides access to what would have been argv[0]. [Objective] C[++] are of course all in the same boat, as are Haskell and Go.

"Interpreted" languages (i.e. those whose programs are normally executed by starting a designated "interpreter" program and passing it the path to the program to be started), on the other hand, can do much better than this: Since the interpreter must open the program to run it, it will have a complete (though possibly relative) and accurate path to the program. So, it's very simple for such languages to make this information available to programs somehow.

Plea for help

I really want to make these questions easier to find. I can't see this happening without some sort of tag, since there doesn't seem to be a convenient word or phrase in either English or computer-science-ese to use as a search term. Unfortunately, this also makes it hard to figure out what to call the tag in the first place.

So, please chime in with whatever you can think of that might help:

  • Better tag names

  • Words or phrases I may have missed

  • Ways to persuade people not to zap the tag in the tag wiki.

  • ???

  • Profit!

share|improve this question
@awoodland: As a workaround for a defect in computer-science-ese, basically. If I wanted to see how to do it in Python, I would then search for "[python] [argv0]". Obviously, the discoverability leaves something to be desired; still, this would be a big improvement over what happens now: whenever I try to search for this stuff, I get a bunch of irrelevant questions, and if I'm lucky there will also be a small fraction of the relevant ones as well. – SamB Feb 13 '12 at 20:58
(Sorry, I ran out of space and made it into an answer) – Flexo Feb 13 '12 at 20:59
up vote 5 down vote accepted

This shouldn't be a single tag at all.

It's a small, very specific problem and it's always going to be language specific. A Perl user in general doesn't care what a Java user does to solve the same problem in Java. There's no real complexity to the issue either - once you know the answer for a given language you know the answer and there's no more depth.

Furthermore people asking/searching don't know what the name of the tag is in the first place, precisely because they don't know what they're looking for.

share|improve this answer
It's a bit "meta", I admit, but I never really bought the whole "no meta tags" idea in the first place. (Just because most meta tags are useless doesn't mean they all are.) – SamB Feb 13 '12 at 21:03
And it's also true that my proposal is lacking in discoverability, but I can't see how that can be avoided. (If you can, please share!) – SamB Feb 13 '12 at 21:04
@SamB The problem I have is working out who are the tag experts and who subscribes to the tag? An expert would have to have some experience in every language ever invented! As far as I know there's no universal terminology. – Flexo Feb 13 '12 at 21:10
@SamB - I'm open to other suggestions though if something good comes along :) – Flexo Feb 13 '12 at 21:12
And it's true that some of these questions are fairly trivial, but (a) people don't always use the same meaning of "program" in these questions: it could refer to an individual module, to whatever script an interpreter was called to run, to a fastcgi script, etc. (b) some languages, like C, haven't got a single portable and reliable method: reliable methods are not portable, and "portable" methods are not reliable (c) there seem to be a lot of duplicates or near-duplicates already. – SamB Feb 13 '12 at 21:14
Is it that big a deal if nobody can qualify as an expert? – SamB Feb 13 '12 at 21:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .