Quote:
Originally posted by CodeMonkey
Using argv[0] on a console program gives you the full pathname. This is good, but I need it in shortened DOS-style so I can use it in system(). You know, the little '~' and no spaces. Is there a way to do this, or do I need to make my own translator (agh!!)?
well first of all what argv[0] gives you is implementation-specific. second of all taking "longfoobar.foobar" and shortening it to "longfo~1.foo" does absolutely nothing for you; there is no guaranteed correspondance of any sort between the long file names and their shortened versions. also, what compiler is this? i'm curious because djgpp accepts lfns in system() calls, and obviously any windoze compiler will.