Re: is_dir paths

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

 



> > var_dump (realpath('temp'));
>  > I am trying to check whether /lists/admin/temp exists (which it does).
>
> This dir doesn't exists. The '/' at the beginning of path means: path is
> from root (unix) or from e.g. c:\ (windows)
>
> Outputs from
>
> var_dump(realpath("../../lists/admin/temp"))
> var_dump(realpath('temp'));
>
> are same and thus you working directory is 'C:\...\htdocs\lists\admin'.
> If you need check existence of dir 'temp' in your current working
> directory you can try one of:
>
> is_dir('temp');
> is_dir('./temp');
> is_dir('C:\...\htdocs\lists\admin\temp');
>

I see. I thought this function would work with paths relative to the
webroot. Thanks for pointing out my mistake.

Does such a function exist?

The problem I have is that this path is set in the config section of a 3rd
party tool I'm using, and called from various pages within the site. I don't
want to hack the code, as that will make upgrades more difficult to apply.
Hard-coding the path from c: won't work well either, as that path is
different in the development and live environments.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux