Author: Joshua Shriver
Date: 22:36:15 06/12/04
Go up one level in this thread
I'll agree. I have used this a lot when on different platforms (OS X, Windows and Linux) and it seems to work. Though whether argv always work is dependant on the host OS. So argv might not be reliable at all times. The following post by Mr. Corbit makes sense. Might be worth to check argv, and if it works great, if not have an else catch it. Just trying to help :) Sincerely, Joshua Shriver >>} > >Based on Dann Corbit's post I cannot trust it so I think that I will not try to >use it inspite of the fact that now it works because tomorrow with a new >compiler it may stop to work. > >Here are Dann Corbit's words: > >This information from the C-FAQ may be relevant: >19.31: How can my program discover the complete pathname to the > executable from which it was invoked? > >A: argv[0] may contain all or part of the pathname, or it may > contain nothing. You may be able to duplicate the command > language interpreter's search path logic to locate the > executable if the name in argv[0] is present but incomplete. > However, there is no guaranteed solution. > >Uri
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.