Re: how to represent current directory in C program.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



qiang zeng wrote:
Dear all,

I have a maybe simple question, but it's a headache for me:-)
my question is how to represent current directory in C program.
when i am using execlp()  function in my c program.
i always have to key in the directory where the file is located.
is there a simple method ? for example a simple sign like '../'
or 'use pwd',but how?

thanks in advance.
Zq

1) wrong place to ask this type of question.
2) "man execlp" would yield the answer you are looking for.
3) execlp uses the current process' environment so if "." is in your PATH, no path for current directory is necessary. if "." is not in your environment, "./programname" should suffice.


kr

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux