See <a href="http://www.php.net/realpath">http://www.php.net/realpath</a><br><br><b>realpath()</b> expands all symbolic links and
resolves references to '/./', '/../' and extra '/' characters in
the input <i><tt>path</tt></i> and return the canonicalized
absolute pathname. The resulting path will have no symbolic link,
'/./' or '/../' components.<br><br><div><span class="gmail_quote">On 3/14/07, <b class="gmail_sendername">Darren Oh</b> <<a href="mailto:darrenoh@sidepotsinternational.com">darrenoh@sidepotsinternational.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Some users keep contributed modules outside the Drupal directory and<br>
create symlinks to them in sites/all/modules. This causes problems<br>for Chat Room, which uses a PHP file in its own directory for AJAX<br>updates (to avoid loading all of Drupal on each update) but must<br>include some files from Drupal. I was using the following code to
<br>find the Drupal files:<br><br> $chatroom_base = urldecode($_POST['chatroom_base']);<br> $depth = substr_count($chatroom_base, '/');<br> chdir(str_repeat('../', $depth+1));<br><br>If people are keeping Chat Room outside of Drupal, chdir() will need
<br>the absolute path to the Drupal directory. What is the best way to<br>get this?<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://2bits.com">2bits.com</a><br><a href="http://2bits.com">http://2bits.com
</a><br>Drupal development, customization and consulting.