Mailinglist Archive: opensuse (3104 mails)

< Previous Next >
Re: [SLE] programming question
  • From: muskrat@xxxxxxxxx (Jeffrey Taylor)
  • Date: Sun, 2 Apr 2000 23:10:17 -0500
  • Message-id: <20000402231017.A20867@xxxxxxxxxxxxxxxxxxxxx>



If I understand what you want, there is a function called getcwd, (GET
Current Working Directory) that does what you want. (see program
at end) It is not ANSI standard C. It works with SuSE 6.1, YMMV.
I've installed additional libraries and upgraded a few. I suspect it
is available on most systems.

HTH,
Jeffrey


Quoting jason <jasonunrein@xxxxxxxxxxx>:
> ok i'm desperate and kan't find an answer.
>
> Does anyone know how 2 get the directory of the programming
> currently running. ie, fubar (the app) is stored in /usr/bin i do:
> cd / fubar
>
> output should be "/usr/bin"
>
> how would i do this. I've tried everything i can think of and
> everything in my books and i still can't get it to work. btw it's
> in c

============================= cut here =============================
#include <stdio.h>

int main(int argc, char *argv[])
{
printf("%s\n", getcwd());
}


--
To unsubscribe send e-mail to suse-linux-e-unsubscribe@xxxxxxxx
For additional commands send e-mail to suse-linux-e-help@xxxxxxxx
Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/


< Previous Next >
Follow Ups
References