• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

C function to return the name of the current exe and current working directory?

I don't think there is a standard C function for either. For UNIX, there is getcwd to get the current directory, not sure about the running app (though argv provides that). The Windows API has functions for both, but don't know their names off the top of my head.
 
Originally posted by: Cerebus451
I don't think there is a standard C function for either. For UNIX, there is getcwd to get the current directory, not sure about the running app (though argv provides that). The Windows API has functions for both, but don't know their names off the top of my head.

Doh ... I'm really brainlocked today. Gotta lay off those paint chips & dip.
Thanks
 
Originally posted by: Armitage
Originally posted by: Cerebus451
I don't think there is a standard C function for either. For UNIX, there is getcwd to get the current directory, not sure about the running app (though argv provides that). The Windows API has functions for both, but don't know their names off the top of my head.

Doh ... I'm really brainlocked today. Gotta lay off those paint chips & dip.
Thanks

No kidding 😛 even I (the java developper) was going to answer that one. 😉

And guys suggesting windows stuff, I don't think he's programming with a microsoft api (just a hunch) 🙂
 
Originally posted by: kamper
Originally posted by: Armitage
Originally posted by: Cerebus451
I don't think there is a standard C function for either. For UNIX, there is getcwd to get the current directory, not sure about the running app (though argv provides that). The Windows API has functions for both, but don't know their names off the top of my head.

Doh ... I'm really brainlocked today. Gotta lay off those paint chips & dip.
Thanks

No kidding 😛 even I (the java developper) was going to answer that one. 😉

And guys suggesting windows stuff, I don't think he's programming with a microsoft api (just a hunch) 🙂

There are probably 15-20 OS out there that will run C code.

Let the information flow freely from that block upstairs.


 
Originally posted by: EagleKeeper
There are probably 15-20 OS out there that will run C code.

Let the information flow freely from that block upstairs.
Alright, maybe I didn't need to say that. I just figured that what you were suggesting probably wasn't applicable to him. Sharing knowledge is, of course, always a good thing.
 
Yep ... was looking for the straight C answer to the extent possible since my stuff often runs on a variety of platforms. I suspect getcwd may be unix specific though, as it's in unistd.h Which is OK ... I highly doubt this particular code will ever see the inside of an MS OS.

It's good to be doing C/C++ again for a bit, but I'm rusty 😛 Fun piece of code though 😀
 
Originally posted by: EagleKeeper
Originally posted by: kamper
Originally posted by: Armitage
Originally posted by: Cerebus451
I don't think there is a standard C function for either. For UNIX, there is getcwd to get the current directory, not sure about the running app (though argv provides that). The Windows API has functions for both, but don't know their names off the top of my head.

Doh ... I'm really brainlocked today. Gotta lay off those paint chips & dip.
Thanks

No kidding 😛 even I (the java developper) was going to answer that one. 😉

And guys suggesting windows stuff, I don't think he's programming with a microsoft api (just a hunch) 🙂

There are probably 15-20 OS out there that will run C code.

Let the information flow freely from that block upstairs.

Yep ... actually, are there any OS that don't run C/have a C compiler? Or aren't ptimarily written in C/C++ for that matter. Nothing significant I suspect.

 
Back
Top