<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get the PWD in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-pwd/m-p/2986478#M718369</link>
    <description>Hi,&lt;BR /&gt;For myself, it works perfectly:&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;        printf("%s\n",getenv("PWD"));&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#cc -o toto toto.c&lt;BR /&gt;#./toto&lt;BR /&gt;/tmp&lt;BR /&gt;&lt;BR /&gt;What's your code that return NULL ?&lt;/STDLIB.H&gt;</description>
    <pubDate>Mon, 02 Jun 2003 13:47:25 GMT</pubDate>
    <dc:creator>Bruno Vidal</dc:creator>
    <dc:date>2003-06-02T13:47:25Z</dc:date>
    <item>
      <title>How to get the PWD</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-pwd/m-p/2986477#M718368</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;how do I get the working directory in my c code?&lt;BR /&gt;&lt;BR /&gt;I used `getenv` to get the current work directory, but it is returning NULL.&lt;BR /&gt;&lt;BR /&gt;TIA&lt;BR /&gt;satya&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Jun 2003 13:32:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-pwd/m-p/2986477#M718368</guid>
      <dc:creator>Satya_6</dc:creator>
      <dc:date>2003-06-02T13:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the PWD</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-pwd/m-p/2986478#M718369</link>
      <description>Hi,&lt;BR /&gt;For myself, it works perfectly:&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;        printf("%s\n",getenv("PWD"));&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#cc -o toto toto.c&lt;BR /&gt;#./toto&lt;BR /&gt;/tmp&lt;BR /&gt;&lt;BR /&gt;What's your code that return NULL ?&lt;/STDLIB.H&gt;</description>
      <pubDate>Mon, 02 Jun 2003 13:47:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-pwd/m-p/2986478#M718369</guid>
      <dc:creator>Bruno Vidal</dc:creator>
      <dc:date>2003-06-02T13:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the PWD</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-pwd/m-p/2986479#M718370</link>
      <description>The cleaner way to do this from C is to simply use the getcwd() function. Man 3 getcwd for details.&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Jun 2003 13:49:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-pwd/m-p/2986479#M718370</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-06-02T13:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the PWD</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-pwd/m-p/2986480#M718371</link>
      <description>getcwd() and getenv("PWD") may disagree if you cd through a symbolic link.  The shell tracks current working directory with the symbolic link name in PWD.  The getcwd() function uses a series of ".." steps with readdir and lstat to find the real directory names on the way to up to "/".&lt;BR /&gt;&lt;BR /&gt;% echo $PWD&lt;BR /&gt;/home/stroyan&lt;BR /&gt;% mkdir real&lt;BR /&gt;% ln -s real symbolic&lt;BR /&gt;% cd symbolic&lt;BR /&gt;% echo $PWD          &lt;BR /&gt;/home/stroyan/symbolic&lt;BR /&gt;% pwd&lt;BR /&gt;/home/stroyan/symbolic&lt;BR /&gt;% /usr/bin/pwd &lt;BR /&gt;/home/stroyan/real&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Jun 2003 14:30:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-pwd/m-p/2986480#M718371</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2003-06-02T14:30:13Z</dc:date>
    </item>
  </channel>
</rss>

