![]() |
Running an application
Is there any function that I can called to run a program at a specifc directory ?
|
Re: Running an application
On Windows, use CreateProcess.
On Linux, use the execv family of functions. These functions allow you to specify the working directory. |
Re: Running an application
gosh , I nearly fainted looking at the function's agruement
:( , how about some example ? Like launching hl ? |
Re: Running an application
search for MSDN...
http://msdn.microsoft.com |
Re: Running an application
Quote:
example of opening .rtf document : Code:
ShellExecute(theApp.m_pMainWnd->GetSafeHwnd(),NULL,"document.rtf",NULL,"C:\\foo",SW_SHOW); |
Re: Running an application
thanks for the reply kx , but I think shellexcute cant specify a specific directory of the program
|
Re: Running an application
CreateProcess is not that complicated. There are good examples on MSDN, look it up, it's well explained.
|
Re: Running an application
Quote:
|
Re: Running an application
well I have found the ultimate guide to executing stuff about year ago, but is down now, so I'll post here important things :)
Code:
Execute Program Way 1 |
Re: Running an application
I see , thanks !
|
Re: Running an application
Final question , what function should I use to create a folder ?
|
Re: Running an application
Code:
mkdir() |
Re: Running an application
mkdir() on windows does not correspond to mkdir() on Linux.
Use something like that: Code:
#ifdef WIN32 |
Re: Running an application
wow ! Pierre , I will marry you if you're a female :D
|
Re: Running an application
no, thank you. I'm not, and I'm not gay either >:(
|
Re: Running an application
Quote:
|
Re: Running an application
well I have grepped my /usr/include directory in my Debian GNU/linux 3.0 and found no .h files has "mkdir()"
and this also doesn't work: PHP Code:
|
Re: Running an application
#include <direct.h>
in my vc++ 6.0 |
Re: Running an application
well I suppose you don't know what GNU/Linux operating system is...
It's "not unix", but it's also absolutely not Windows. :D the GNU/Linux operating system, which is commonly mis-named as "Linux", is a free UNIX clone operating system. It's mostly using GNU software with Linux as the kernel. As it's free everyone can make their own version of system, currently the most popular version is Red Hat Linux (which is only available for purchasing). If you want to download a version, you can download Debian GNU/Linux 3.0 r3 at: http://www.debian.org (the size is as big as 7 cds as it contains tons of software) There's also a version at free software foundation's ftp server, which is much smaller (only 1 cd): ftp://ftp.gnu.org/gnu+linux-distros/...86-pentium.iso to install it, you'll need a CD-RW drive to burn the ISO images to CDs. then boot from the CD and follow the instructions. (another thing is MS Visual C++ doesn't work on GNU/Linux :D) |
Re: Running an application
Ahhhhh, Linux.
Crappy Linux. Code:
/* mkrmdir.c -- BSD compatible directory functions for System V |
All times are GMT +2. The time now is 04:54. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.