|
|
| Author |
Message |
|
|
iswariak Familiar Face
Joined: 28 Jun 2006 Posts: 8
|
Posted: Mon Jul 03, 2006 5:34 am Post subject: How to get absolute path in GTK- C |
|
|
Hi all
How to get an absolute path of an file in GTK.
Thanks in advance.
Iswaria. |
|
| Back to top |
|
 |
iswariak Familiar Face
Joined: 28 Jun 2006 Posts: 8
|
Posted: Mon Jul 03, 2006 8:49 am Post subject: Code to find the absolute path of the current directory |
|
|
Hi
Code to find the absolute path of the current directory
--------------------------------------------------------------------
#include <stdio.h>
int main() {
FILE *in;
extern FILE *popen();
char buff[512];
/* popen creates a pipe so we can read the output
of the program we are invoking */
if (!(in = popen("pwd", "r"))) {
exit(1);
}
/* read the output of netstat, one line at a time */
while (fgets(buff, sizeof(buff), in) != NULL ) {
printf("Output: %s", buff);
}
/* close the pipe */
pclose(in);
}
--------------------------------------------------------------------
Regards
Iswaria. |
|
| Back to top |
|
 |
Micah Carrick Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 465 Location: Portland, OR USA
|
|
| Back to top |
|
 |
|